在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ cli構(gòu)建vue報錯[Vue warn]: Cannot find elemen

cli構(gòu)建vue報錯[Vue warn]: Cannot find element: #prop-example-2

我在肯Vue官方文檔的時候出現(xiàn)了一個十分嚴重的問題
在使用官方給的例子的時候遇到了一些坑導致總是報錯,幾番查詢也沒有解決問題依然報錯
具體該怎么說我也不大清楚直接上代碼了
cli構(gòu)建完項目之后,我直接在文檔里面粘貼代碼進行測試 動態(tài)prop

<template>
  <div id="app">
    <img src="./assets/logo.png">
    <router-view/>
    <div id="prop-example-2">
      <input v-model="parentMsg">
      <br>
      <child v-bind:my-message="parentMsg"></child>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
Vue.component('child', {
  // 在 JavaScript 中使用 camelCase
  props: ['myMessage'],
  template: '<span>{{ myMessage }}</span>'
})
new Vue({
  el: '#prop-example-2',
  data(){
    return{

      parentMsg: 'Message from parent'
    }
  }
})
export default {
  name: 'App'
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

沒有找到什么地方寫的有問題 總是會報兩個錯誤
1、[Vue warn]: Cannot find element: #prop-example-2
2、[Vue warn]: Property or method "parentMsg" 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 components, by initializing the property.

求大神指點!?。∪f分感謝?。。?/p>

回答
編輯回答
陌如玉

1.餓了么ui沒有下,
2.messg方法沒有寫

2017年8月7日 04:04