vue 手动挂载 $amount()

$mount()手动挂载

当Vue实例没有el属性时,则该实例尚没有挂载到某个dom中; 假如需要延迟挂载,可以在之后手动调用vm.$mount()方法来挂载。例如:

new Vue({
router,
render: h => h(App)
}).$mount("#app");

或者

new Vue({
el: '#app',
router,
render: h => h(App)
});

 

posted @ 2018-05-18 10:48  金桂花季  阅读(2269)  评论(0)    收藏  举报