有没有办法在 vue.js 中注册用于 cypress 组件测试的全局自定义指令。只需注册
app.directive('some',(el,binding)=>{{...})
在 main.js 文件中无法解决问题。因为在组件测试组件失败时解析该指令。
像这样的本地寄存器:
mount(SomeComp,{
directive:{
'some': {...}
})
不是好的选择。因为我在每个组件中都使用这个指令并且需要在每个组件中进行本地注册。
我如何注册柏树组件测试的全局指令?
谢谢