我也阅读了3次vue-utils-test文档和开玩笑的文档,但是我不知道如何在vue组件中精确模拟vue mixins并测试该组件。
有两种方法:
const localVue = createLocalVue()
localVue.mixin(myMixin)
const wrapper = shallow(Post, {
localVue,
})
mixins
安装选项:const wrapper = shallow(Post, {
mixins: [myMixin],
})
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句