注意components与component的区别,跟配置无关

1.可以作用到Vue.component 这个全局注册方法里, 也可以在任意vue模板里使用<apple>组件

 var apple = Vue.extend({
    ....
 })
 Vue.component('apple',apple) 

2.可以作用到vue实例或者某个组件中的components属性中并在内部使用apple组件

 new Vue({    
      components:{
        apple:apple
      }
   })

vue中 import引入组件

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-05-22
  • 2021-06-25
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2021-09-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案