Browse Source

respect scope for one-time prop

Evan You 10 years ago
parent
commit
071f6fdd23
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/compiler/compile-props.js

+ 1 - 2
src/compiler/compile-props.js

@@ -130,8 +130,7 @@ function makePropsLinkFn (props) {
         if (vm._context) {
           if (prop.mode === propBindingModes.ONE_TIME) {
             // one time binding
-            // TODO respect scope here
-            value = vm._context.$get(prop.parentPath)
+            value = (scope || vm._context).$get(prop.parentPath)
             _.initProp(vm, prop, value)
           } else {
             // dynamic binding