Vue总结

真实的开发情况下index.html里的<div id="app"></div>里是不写东西的,
而是在main.js里的vue实例里,加 template属性,在template属性里面写HTML标签。
在template里的标签会自动替换index.html里的挂载vue实例的标签

在main.js里的
new Vue({
  el: '#app',
template: `
<h2>{{ message }}</h2>
<button>按钮</button>
<h2>{{ name }}</h2>
`,
data: {
message: 'hello webpack',
name: '温'
},
})

在index.html里的
<div id="app">

</div>
 

posted on 2020-11-12 17:32  catchsa  阅读(337)  评论(0)    收藏  举报

导航