var vm = new vue({...}) // 創(chuàng)建 vue 實(shí)例
1. 渲染 vue 實(shí)例有兩種方法:
vm.$mount(" #app ");
new vue ({
???? el:" #app ",??? // 隱式渲染
???? ..........
})
vue的兩種渲染方式
上述隱式渲染可以去除 template ,此時(shí) vue 將提取 ‘#app’? 的 html 內(nèi)容。
上述模板叫做 html模板,使用 template 叫做字符串模板
模板存在的目的在于和數(shù)據(jù)綁定: