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

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

我在肯Vue官方文檔的時(shí)候出現(xiàn)了一個(gè)十分嚴(yán)重的問題
在使用官方給的例子的時(shí)候遇到了一些坑導(dǎo)致總是報(bào)錯(cuò),幾番查詢也沒有解決問題依然報(bào)錯(cuò)
具體該怎么說我也不大清楚直接上代碼了
cli構(gòu)建完項(xiàng)目之后,我直接在文檔里面粘貼代碼進(jìn)行測試 動(dòng)態(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>

沒有找到什么地方寫的有問題 總是會(huì)報(bào)兩個(gè)錯(cuò)誤
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.

求大神指點(diǎn)?。。∪f分感謝?。?!

回答
編輯回答
陌如玉

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

2017年8月7日 04:04