UNPKG

datamax-cli

Version:

datamax plugin cli

76 lines (68 loc) 1.67 kB
// 导入颜色选择器组件 import testset from './testset/testset.vue' class configClass { constructor(type, name, content) { this.content = content; this.type = type; this.name = name; } } let base_attr = [ { type: "max_num", name: "图表尺寸", num_begin: 0, num_end: 0, content: "300|180", color: "", firstLabel: "宽度", secondLabel: "高度", }, { type: "max_num", name: "图表位置", num_begin: 0, num_end: 0, content: "0|0", color: "", firstLabel: "横坐标", secondLabel: "纵坐标", }, { type: "max_num", name: "其他", num_begin: 0, num_end: 0, content: "0|1", color: "", firstLabel: "旋转角度", secondLabel: "透明度", }, ]; // 存储组件列表 const components = [ testset ] // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册 const install = function (Vue) { // 判断是否安装 if (install.installed) return // 遍历注册全局组件 components.map(component => Vue.component(component.name, component)) } let menusConfig = {"parent":"icon_other_all","img":"img_time_selector","desc":"测试插件","type":"testset","type_parent":"other","icon":"iconimg_time_selector"} let config = base_attr; let selfDefineCOnfig = new configClass( "max_scope_num", "测试数字属性", "0|65|100" ); config.push(selfDefineCOnfig); export default { // 导出的对象必须具有 install,才能被 Vue.use() 方法安装 install, // 以下是具体的组件列表 testset, menusConfig, config }