vue-new Vue參數對象


new Vue參數對象

在腳手架cli2中是這樣寫的:

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})

在腳手架cli3中是這樣寫的:

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

cl2中 參數對象的理解:

el就是選擇掛載元素
components注冊組件
template模板替換組件進行渲染 https://blog.csdn.net/zhangjieshuaige/article/details/83622973

cl3中 參數對象的理解:

可以看到去除了el components template
增加了 render $mount
render 的理解:
https://blog.csdn.net/qq78827534/article/details/80792514?utm_medium=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromMachineLearnPai2~default-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromMachineLearnPai2~default-1.control
$mount 的理解:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM