main.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * @Descripttion:
  3. * @Author: kcz
  4. * @Date: 2021-05-02 16:04:02
  5. * @LastEditors: kcz
  6. * @LastEditTime: 2021-05-21 13:55:46
  7. */
  8. // 引入@babel/polyfill处理兼容
  9. import "@babel/polyfill";
  10. import Vue from "vue";
  11. import App from "./App.vue";
  12. import router from "./router/";
  13. import KFormDesign from "../packages/index";
  14. import Cmp from "./components/CustomComponent/index.vue";
  15. // const Cmp = {
  16. // name: "cmp",
  17. // render: function(h) {
  18. // return h("div", "我是自定义组件");
  19. // }
  20. // };
  21. KFormDesign.setFormDesignConfig({
  22. title: "测试自定义字段",
  23. list: [
  24. {
  25. type: "demo", // 表单类型
  26. label: "自定义组件", // 标题文字
  27. icon: "icon-gallery",
  28. component: Cmp,
  29. options: {
  30. defaultValue: undefined,
  31. multiple: false,
  32. disabled: false,
  33. width: "100%",
  34. clearable: true,
  35. placeholder: "请选择",
  36. showSearch: false
  37. },
  38. model: "",
  39. key: "",
  40. rules: [
  41. {
  42. required: false,
  43. message: "必填项"
  44. }
  45. ]
  46. }
  47. ],
  48. uploadFile: "",
  49. uploadImage: "",
  50. uploadFileName: "",
  51. uploadImageName: "",
  52. uploadFileData: { data: 1545 },
  53. uploadImageData: { data: 1545 },
  54. uploadFileHeaders: { data: 1545 },
  55. uploadImageHeaders: { data: 1545 }
  56. });
  57. Vue.use(KFormDesign);
  58. // KFormDesign.setFormBuildConfig({
  59. // dynamicData: {
  60. // test: [
  61. // { label: "test", value: "1" },
  62. // { label: "test1", value: "2" }
  63. // ]
  64. // }
  65. // });
  66. Vue.config.productionTip = false;
  67. new Vue({
  68. router,
  69. render: h => h(App)
  70. }).$mount("#app");