javascript - vuejs的extend方法在vue2中不知道是否还有,解释一下
ringa_lee
ringa_lee 2017-04-17 16:31:49
0
2
487
ringa_lee
ringa_lee

ringa_lee

reply all(2)
左手右手慢动作

Migrate from Vue 1.x to 2.x
Migrate from Vue Router 0.7.x to 2.x
Migrate from Vuex 0.6.x to 1.0(2.0)

左手右手慢动作

Not much change in writing style.
We provide you with two writing methods, you can use them according to your situation


const router = new VueRouter({ .... })

...
// 第一种写法
const app = new Vue({
    router,
    ...App // 扩展
}).$mount('#app')

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

In additionVue.extend is to use the basic Vue constructor to create a "subclass". The parameter is an object containing the component's options.
Look at the source code and it will be clear at a glance. global-api/extend

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!