You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.4 KiB
60 lines
1.4 KiB
import EventBus, {
|
|
$on,
|
|
$once,
|
|
$off,
|
|
$emit
|
|
} from './utils/eventBus'
|
|
import GuipButton from './GuipButton'
|
|
import GroupFormBtns from './GroupFormBtns'
|
|
import GuipInput from './GuipInput'
|
|
import PromptText from './PromptText'
|
|
import GuipTextarea from './GuipTextarea'
|
|
import DevicePreview from './DevicePreview'
|
|
import GuipRadio from './GuipRadio'
|
|
import GuipSelect from './GuipSelect'
|
|
import GuipFormItem from './GuipFormItem'
|
|
import CustomDropdown from './CustomDropdown'
|
|
import 'element-ui/lib/theme-chalk/index.css' // 如果依赖Element
|
|
import './styles/index.css' // 全局引入
|
|
import './styles/common.scss' // 全局引入
|
|
import { directive as clickaway } from 'vue-clickaway'
|
|
const components = [
|
|
GuipButton,
|
|
GroupFormBtns,
|
|
GuipInput,
|
|
PromptText,
|
|
GuipTextarea,
|
|
DevicePreview,
|
|
GuipRadio,
|
|
GuipSelect,
|
|
GuipFormItem,
|
|
CustomDropdown
|
|
]
|
|
|
|
const install = function (Vue) {
|
|
// 挂载到Vue原型
|
|
Vue.prototype.$eventBus = EventBus
|
|
Vue.prototype.$on = $on
|
|
Vue.prototype.$emit = $emit
|
|
Vue.directive('clickaway', clickaway)
|
|
components.forEach(component => {
|
|
if (!component.name) {
|
|
throw new Error(`Component name is required: ${component}`)
|
|
}
|
|
Vue.component(component.name, component)
|
|
})
|
|
}
|
|
|
|
export default {
|
|
install,
|
|
GuipButton,
|
|
GroupFormBtns,
|
|
GuipInput,
|
|
PromptText,
|
|
GuipTextarea,
|
|
DevicePreview,
|
|
GuipRadio,
|
|
GuipSelect,
|
|
GuipFormItem,
|
|
CustomDropdown
|
|
}
|