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>

 顯示出來了

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM