Преглед изворни кода

fix #2366 custom terminal directive with global mixin

rhyzx пре 10 година
родитељ
комит
97b82f8033
2 измењених фајлова са 3 додато и 2 уклоњено
  1. 2 1
      src/compiler/compile.js
  2. 1 1
      test/unit/specs/compiler/compile_spec.js

+ 2 - 1
src/compiler/compile.js

@@ -627,7 +627,8 @@ function makeTerminalNodeLinkFn (el, dirName, value, options, def) {
     filters: parsed.filters,
     filters: parsed.filters,
     raw: value,
     raw: value,
     // either an element directive, or if/for
     // either an element directive, or if/for
-    def: def || publicDirectives[dirName]
+    // #2366 or custom terminal directive
+    def: def || resolveAsset(options, 'directives', dirName)
   }
   }
   // check ref for v-for and router-view
   // check ref for v-for and router-view
   if (dirName === 'for' || dirName === 'router-view') {
   if (dirName === 'for' || dirName === 'router-view') {

+ 1 - 1
test/unit/specs/compiler/compile_spec.js

@@ -636,7 +636,7 @@ describe('Compile', function () {
   })
   })
 
 
   it('allow custom terminal directive', function () {
   it('allow custom terminal directive', function () {
-    Vue.mixin({})
+    Vue.mixin({}) // #2366 conflict with custom terminal directive
     Vue.compiler.terminalDirectives.push('foo')
     Vue.compiler.terminalDirectives.push('foo')
     Vue.directive('foo', {})
     Vue.directive('foo', {})