Evan You il y a 10 ans
Parent
commit
81c195f31d

+ 1 - 0
src/directives/public/for.js

@@ -333,6 +333,7 @@ const vFor = {
       setTimeout(op, staggerAmount)
     } else {
       var target = prevEl.nextSibling
+      /* istanbul ignore if */
       if (!target) {
         // reset end anchor position in case the position was messed up
         // by an external drag-n-drop library.

+ 1 - 0
src/instance/internal/misc.js

@@ -59,6 +59,7 @@ export default function (Vue) {
     } else {
       factory = resolveAsset(this.$options, 'components', value, true)
     }
+    /* istanbul ignore if */
     if (!factory) {
       return
     }

+ 14 - 0
test/unit/specs/util/component_spec.js

@@ -23,6 +23,20 @@ describe('Util - component', function () {
     expect(res.id).toBe('foo')
     expect(res.dynamic).toBe(true)
 
+    // <test is="...">
+    el = document.createElement('test')
+    el.setAttribute('is', 'foo')
+    res = _.checkComponentAttr(el, mockOptions)
+    expect(res.id).toBe('foo')
+    expect(res.dynamic).toBeUndefined()
+
+    // <test :is="...">
+    el = document.createElement('test')
+    el.setAttribute(':is', 'foo')
+    res = _.checkComponentAttr(el, mockOptions)
+    expect(res.id).toBe('foo')
+    expect(res.dynamic).toBe(true)
+
     // custom element, not defined
     el = document.createElement('test')
     res = _.checkComponentAttr(el, mockOptions)