@varonervar/components
Version:
> 基于[Element-UI](https://element.eleme.cn/#/zh-CN/component/quickstart) 封装常用组件,部分组件参考[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
83 lines (75 loc) • 2.06 kB
JavaScript
/* Automatically generated by './build/bin/build-entry.js' */
import HamBurger from '../packages/ham-burger/index.js'
import ProTable from '../packages/pro-table/index.js'
import SvgIcon from '../packages/svg-icon/index.js'
import WlmLayout from '../packages/wlm-layout/index.js'
import ZCascader from '../packages/z-cascader/index.js'
import ZCheckbox from '../packages/z-checkbox/index.js'
import ZConditions from '../packages/z-conditions/index.js'
import ZEditType from '../packages/z-edit-type/index.js'
import ZForm from '../packages/z-form/index.js'
import ZLabel from '../packages/z-label/index.js'
import ZObjectShow from '../packages/z-object-show/index.js'
import ZRadioButton from '../packages/z-radio-button/index.js'
import ZRadio from '../packages/z-radio/index.js'
import ZSelect from '../packages/z-select/index.js'
import ZTable from '../packages/z-table/index.js'
import ZUpload from '../packages/z-upload/index.js'
const components = [
HamBurger,
ProTable,
SvgIcon,
WlmLayout,
ZCascader,
ZCheckbox,
ZConditions,
ZEditType,
ZForm,
ZLabel,
ZObjectShow,
ZRadioButton,
ZRadio,
ZSelect,
ZTable,
ZUpload
]
function install(Vue, options = {}) {
const { includes, excludes } = options
const COMPONENT = Object.keys(components)
let forEachArr = []
if (Array.isArray(includes) && includes.length) {
forEachArr = COMPONENT.filter((name) => includes.includes(name))
} else if (Array.isArray(excludes) && excludes.length) {
forEachArr = COMPONENT.filter((name) => !excludes.includes(name))
} else {
forEachArr = COMPONENT
}
forEachArr.forEach((key) => {
const component = components[key]
Vue.component(component.name, component)
})
}
/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue)
}
export default {
version: '0.4.8',
install,
HamBurger,
ProTable,
SvgIcon,
WlmLayout,
ZCascader,
ZCheckbox,
ZConditions,
ZEditType,
ZForm,
ZLabel,
ZObjectShow,
ZRadioButton,
ZRadio,
ZSelect,
ZTable,
ZUpload
}