var vm = new vue({...}) // 创建 vue 实例
1. 渲染 vue 实例有两种方法:
vm.$mount(" #app ");
new vue ({
el:" #app ", // 隐式渲染
..........
})

上述隐式渲染可以去除 template ,此时 vue 将提取 ‘#app’ 的 html 内容。

模板存在的目的在于和数据绑定:

var vm = new vue({...}) // 创建 vue 实例
1. 渲染 vue 实例有两种方法:
vm.$mount(" #app ");
new vue ({
el:" #app ", // 隐式渲染
..........
})
上述隐式渲染可以去除 template ,此时 vue 将提取 ‘#app’ 的 html 内容。
模板存在的目的在于和数据绑定:
本文标题:创建 vue 实例
本文链接:https://www.haomeiwen.com/subject/qbkfsxtx.html
网友评论