/* * @Descripttion: * @Author: kcz * @Date: 2021-05-02 16:04:02 * @LastEditors: kcz * @LastEditTime: 2021-05-21 13:55:46 */ // 引入@babel/polyfill处理兼容 import "@babel/polyfill"; import Vue from "vue"; import App from "./App.vue"; import router from "./router/"; import KFormDesign from "../packages/index"; import Cmp from "./components/CustomComponent/index.vue"; // const Cmp = { // name: "cmp", // render: function(h) { // return h("div", "我是自定义组件"); // } // }; KFormDesign.setFormDesignConfig({ title: "数据字段", list: [ { type: "input", // 表单类型 label: "自定义组件", // 标题文字 icon: "icon-gallery", component: Cmp, options: { type:'CustomComponents', defaultValue: undefined, multiple: false, disabled: false, width: "100%", clearable: true, placeholder: "请选择", showSearch: false }, model: "", key: "", rules: [ { required: false, message: "必填项" } ] }, { type: "input", // 表单类型 label: "当前用户", // 标题文字 icon: "icon-write", options: { type: "CurrentUser", width: "100%", // 宽度 defaultValue: "", // 默认值 placeholder: "请输入", // 没有输入时,提示文字 clearable: false, maxLength: null, addonBefore: "", addonAfter: "", hidden: false, // 是否隐藏,false显示,true隐藏 disabled: true // 是否禁用,false不禁用,true禁用 }, model: "", // 数据字段 key: "", help: "", rules: [ //验证规则 { required: false, // 必须填写 message: "必填项" } ] }, { type: "input", // 表单类型 label: "当前部门", // 标题文字 icon: "icon-write", options: { type: "CurrentDepartment", width: "100%", // 宽度 defaultValue: "", // 默认值 placeholder: "请输入", // 没有输入时,提示文字 clearable: false, maxLength: null, addonBefore: "", addonAfter: "", hidden: false, // 是否隐藏,false显示,true隐藏 disabled: true // 是否禁用,false不禁用,true禁用 }, model: "", // 数据字段 key: "", help: "", rules: [ //验证规则 { required: false, // 必须填写 message: "必填项" } ] }, ], uploadFile: "", uploadImage: "", uploadFileName: "", uploadImageName: "", uploadFileData: { data: 1545 }, uploadImageData: { data: 1545 }, uploadFileHeaders: { data: 1545 }, uploadImageHeaders: { data: 1545 } }); Vue.use(KFormDesign); // KFormDesign.setFormBuildConfig({ // dynamicData: { // test: [ // { label: "test", value: "1" }, // { label: "test1", value: "2" } // ] // } // }); Vue.config.productionTip = false; new Vue({ router, render: h => h(App) }).$mount("#app");