文档目录:

|--components

  |-loading(组件文件夹)

    |-loading.vue (loading组件核心)

    |-index.js  //配置导出组件,并且install

 

主要配置到处文件index.js 代码

 import LoadingComponent from './loading.vue'  //引用组件文件
  

  //定义并注册组件

  const Loading = {
      install: function(Vue) {
          Vue.component('Loading', LoadingComponent)
      }
  }

export default Loading   //导出组件.......

 

在main.js里调用组件

import Loading from './components/loading'

Vue.use(Loading)

 

相关文章:

  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-08-04
  • 2021-11-02
  • 2021-06-01
  • 2021-10-18
猜你喜欢
  • 2021-12-28
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
相关资源
相似解决方案