var MyComponent = Vue.extend({
template: '<div>Hello World</div>'
})
var myAppendTo = Vue.extend({
template:'<p>appendTo</p>'var myBefore = Vue.extend({
template:'<p>before</p>'var myAfter = Vue.extend({
template:'<p>after</p>'// 创建并挂载到 #app (会替换 #app)
new MyComponent().$mount('#app');
手动挂载
new myAppendTo().$mount().$appendTo('#app');appendTo
new myBefore().$mount().$before('#app');before
new myAfter().$mount().$after('#app');after
ul>
li v-if="ok">显示</liv-else>隐藏>
>