$mount()手动挂载

//当Vue实例没有el属性时,则该实例尚没有挂载到某个dom中;
//假如需要延迟挂载,可以在之后手动调用vm.$mount()方法来挂载。例如:
 
new Vue({
//el: '#app',
router,
render: h => h(App)
// render: x => x(App)
// 这里的render: x => x(App)是es6的写法
// 转换过来就是:  暂且可理解为是渲染App组件
// render:(function(x){
//  return x(App);
// });
}).$mount("#app");

相当于

new Vue({
el: '#app',
router,
render: h => h(App)
// render: x => x(App)
// 这里的render: x => x(App)是es6的写法
// 转换过来就是:  暂且可理解为是渲染App组件
// render:(function(x){
//  return x(App);
// });
});

 

相关文章:

  • 2022-01-07
  • 2021-08-16
  • 2021-07-14
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案