在開始學(xué)習(xí)vue.js的時(shí)候, 報(bào)了一個(gè)錯(cuò)誤 vue.js:525 [Vue warn]: Cannot find element: #app下面是我的代碼:
學(xué)習(xí)是最好的投資!
不要放到 template 里面,因?yàn)?template 元素在 DOM 樹里是 #document-fragment,因此其里面的 p 也找不到,參見https://developer.mozilla.org...。
template是單組件的寫法,把templete去掉,一般vue工程都是用vue-cli搭建