فهرست منبع

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,
     raw: value,
     // 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
   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 () {
-    Vue.mixin({})
+    Vue.mixin({}) // #2366 conflict with custom terminal directive
     Vue.compiler.terminalDirectives.push('foo')
     Vue.directive('foo', {})