composition api 使用自定义指令 参数binding.instance 的实例和 getCurrentInstance 返回的实例不一致
Vue version
3.2.41
Link to minimal reproduction
Steps to reproduce
setup 组件内使用自定义指令即可复现
What is expected?
自定义指令取到的 组件实例是页面实例应该一致
What is actually happening?
新的 setup 组件调用原vue2升级上来的自定义指令,由于自定义指令调用大量的mixin 函数,原来通过 binding.instance 调用,现在Instance 不存在全局的mixin,导致报错
System Info
No response
Any additional comments?
No response
Usage of
getCurrentInstance
is strongly discouraged in application code. Do NOT use it as an escape hatch to get the equivalent ofthis
in Composition API.