技术栈:Vue3+TypeScript+Vite
开发环境下控制台告警
Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with markRaw
or using shallowRef
instead of ref
. Component that was made reactive:
翻译: 我们收到了一个组件,它被做成了一个响应对象。这可能会导致不必要的性能开销,应该通过将组件标记为’ markRaw ‘或使用’ shallowRef ‘而不是’ ref '来避免。
解决方案
在报错的源码部分,使用shallowRef或者markRaw