index.js
575 Bytes
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-21 10:36:52
* @LastEditors: limin
* @LastEditTime: 2021-09-24 18:37:14
* @FilePath: \npm\glsx-components\src\index.js
*/
import _Vue from 'vue'
const GLComponents = {}
const componentsFiles = require.context(`./components`, true, /.vue|js$/)
GLComponents.install = Vue => {
if (!Vue) {
window.Vue = Vue = _Vue
}
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
Vue.component(component.name, component)
})
}
export default GLComponents