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

学习下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>

 显示出来了

 

posted @ 2020-07-04 11:02  阿飞afei  阅读(7840)  评论(0编辑  收藏  举报