Property xxx was accessed during render but is not defined on instance. 和 ResizeObserver loop limit

Property xxx was accessed during render but is not defined on instance. 和 ResizeObserver loop limit

  • 问题出现,在Vue3中引入了elementui相关报错

关于今天在Vue3中遇到的Property "size" was a***essed during render but is not defined on instance. 然后还报错了ResizeObserver loop limit /(ㄒoㄒ)/~~

出现的报错意思是 " 属性'xxx(size)'在渲染期间被访问,但未在实例上定义 "

引入elementui中Vue3template里的相关代码

  •  解决方案(☆▽☆)

只需要在对应的组件中在实例中定义即可😊

<script>
import { ref } from 'vue'

export default {
    name:'MyProject',
    setup(){
      const size = ref('')
      return {size}
    }
}
</script>

🤩然后就可以得到一个干干净净的没有报错的控制台啦!o(* ̄▽ ̄*)ブ

 

转载请说明出处内容投诉
CSS教程_站长资源网 » Property xxx was accessed during render but is not defined on instance. 和 ResizeObserver loop limit

发表评论

欢迎 访客 发表评论

一个令你着迷的主题!

查看演示 官网购买