The only thing that seems out of place in your first piece of code is that you are writing Vue.use(Vuetify)
and also using an instance of Vuetify when doing mount.(在您的第一段代码中看起来唯一不合时宜的是,您正在编写Vue.use(Vuetify)
并且在进行安装时还使用了Vuetify的实例。)
I suggest that you keep the Vue.use(Vuetify)
and mount your component like this:(我建议您保留Vue.use(Vuetify)
并像这样安装组件:)
const wrapper = mount(PermissionTable, {
localVue, // vuetify is removed from this object
propsData: {
value: tableItems
}
});
On a side note, unit tests generally should use shallowMount
.(附带说明一下,单元测试通常应使用shallowMount
。) I am not aware of your use case, but, if possible, please use it instead of mount
(我不知道您的用例,但是,如果可能,请使用它而不是mount
) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…