UNPKG

@tarojs/components

Version:
26 lines (24 loc) 888 B
import Vue from 'vue'; import components from './components.js'; import createComponent from './createComponent.js'; import createFormsComponent from './createFormsComponent.js'; components.forEach(params => { if (typeof params === 'string') { Vue.component(params, createComponent(params)); } else if (params instanceof Array) { const [name, props] = params; const { classNames, type = 'simple' } = props; if (type === 'simple') { Vue.component(name, createComponent(name, classNames)); } else if (type === 'forms') { const { event, modelValue } = props; Vue.component(name, createFormsComponent(name, event, modelValue, classNames)); } else if (type === 'component') { Vue.component(name, props.component); } } }); //# sourceMappingURL=index.js.map