随身笔记
随身笔记

解决: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`

解决:这问题在vue3才会出现

不能把变量写在data里面,要写在setup函数中,并return

import {
  Search
} from '@element-plus/icons'


data(){
  return{
     Search
  }
},

改成

import {
Search
} from '@element-plus/icons'

setup(props, context){
  
  return {
    Search  //这return同样在模板中能显示
  }

},

 

 

 

没有标签
首页      前端资源      解决: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`

随身笔记

解决: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`
解决:这问题在vue3才会出现 不能把变量写在data里面,要写在setup函数中,并return import { Search } from '@element-plus/icons' data(){ return{ Search } …
扫描二维码继续阅读
2021-11-29