首页 > 其他 > 详细

Vue Property or method "" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based

时间:2020-07-04 11:13:04      阅读:1072      评论:0      收藏:0      [点我收藏+]

学习下Vue框架

照着教程App.vue加了一个

copyright : {{ corpright }}

main.js

new Vue({
    el: ‘#app‘,
    data:{
      corpright:"wf"
    },
    methods:{
      a:function(){
        return ‘afei‘;
      }
    },
  render: h => h(App),
}).$mount(‘#app‘)

 

刷新页面不显示{{ corpright }}

Property or method "corpright" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based

后来查询到解决方案

在App.vue文件后加

<script>
export default {
  name: ‘hello‘,
  data () {
    return {
      corpright: ‘afei export default‘
    }
  },
  methods: {
         
  }
}
</script>

 显示出来了

技术分享图片

 

Vue Property or method "" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based

原文:https://www.cnblogs.com/kala00k/p/13234194.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!