Open mylmz10 opened 6 years ago
A vnode's componentOptions
does not have a tag
value if you pass a constructor as the first argument of createElement
(https://github.com/vuejs/vue/blob/dev/src/core/vdom/create-element.js#L119).
Your reproduction demonstrates the expected behavior.
@eddyerburgh hi, i can get the componentOptions.tag of each slots on created() or mounted(). On the test, componentOptions.tag is undefined. Why they are different? Therefore i can't test the component and coverage happened very bad.
Is it a bug or do i mistake?
Example component: https://github.com/Nativescript-Vue-Web/Nativescript-Vue-Web/blob/master/src/components/ActionBar.vue
I think it should need to be fixed, some people will use the componentOptions.tag
to check the component type.
I have the same problem, I need componentOptions.tag
to check the component type, but it is undefined
It seems resolved on reproduction link on the first post. @zhixinpeng could you write version of test util?
1.0.0-beta.29
@zhixinpeng sorry it still seems unsolved, you right. The componentOptions.tag is undefined
any news on this issue?
Version
1.0.0-beta.25
Reproduction link
https://codesandbox.io/s/vnz4nm5py?module=%2Ftests%2Funit%2Fcomponents%2FParent.spec.js
Steps to reproduce
What is expected?
It's given 'undefined'
What is actually happening?
Will return ComponentOptions.tag
Is there any solution of how i get componentOptions.tag?