UNPKG

big-ee-ui

Version:

基于element-ui二次封装的UI库

41 lines (36 loc) 1.16 kB
import 'animate.css' import { version } from '../package.json' import BButton from './components/b-button' import BIcon from './components/b-icon' import BElAlert from './components/b-el-alert' import BElCascader from './components/b-el-cascader' import BElCascaderPanel from './components/b-el-cascader-panel' // 定义组件列表 const components = [ BButton, BIcon, BElAlert, BElCascader, BElCascaderPanel ] // 用于全局注册所有组件 // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册, const install = function(Vue) { // 判断是否安装 if (install.installed) return install.installed = true // 遍历注册全局组件 components.map(component => Vue.component(component.name, component)) } // 判断是否是直接引入文件 if (typeof window !== 'undefined' && window.Vue) { install(window.Vue) } // 导出组件信息 export default { version, // 全量引用,导出的对象必须具有 install,才能被 Vue.use() 方法安装 install // 下面这个配置暂时没用 // ...components }