vue3 - 警告 `shallowRef` instead of `ref` - 解决

发布时间 2023-08-16 11:17:51作者: 岑惜

完整警告

[Vue warn]: 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`.

这是因为参数内容有组件,

如 

 元素是图标组件

 

因此需要使用 

shallowRef 即可