From c99baf7132668329823c28037b856a3a429dc909 Mon Sep 17 00:00:00 2001 From: bqy_fe <1743369777@qq.com> Date: Mon, 5 Jul 2021 11:51:03 +0800 Subject: [PATCH] perf: :zap:remove redundant props --- package.json | 2 +- preview/views/comp-render.tsx | 9 +- preview/views/preview.vue | 9 +- preview/views/slot-item.vue | 15 +- .../base-widgets/datetimePicker/index.tsx | 10 +- src/packages/base-widgets/picker/index.tsx | 9 +- src/plugins/element-plus.ts | 12 +- .../components/base-widgets/index.tsx | 5 +- .../components/container-component/index.tsx | 5 +- .../components/custom-component/index.vue | 9 +- .../components/data-source/data-fetch.vue | 11 +- .../components/data-source/data-model.vue | 20 +- .../components/data-source/index.vue | 11 +- .../left-aside/components/page-tree/index.vue | 3 + .../components/page-tree/treeData.ts | 7 - .../components/left-aside/index.vue | 27 +- .../components/left-aside/tabs.ts | 35 -- .../components/event-action/index.tsx | 21 +- .../components/form-rule/index.tsx | 15 + .../right-attribute-panel/components/index.ts | 3 +- .../right-attribute-panel/index.tsx | 35 +- .../simulator-editor/comp-render.tsx | 11 +- .../components/simulator-editor/func.scss | 70 +++- .../simulator-editor/simulator-editor.vue | 32 +- .../components/simulator-editor/slot-item.vue | 39 +-- vite.config.ts | 1 + yarn.lock | 301 ++++++------------ 27 files changed, 335 insertions(+), 392 deletions(-) delete mode 100644 src/visual-editor/components/left-aside/components/page-tree/treeData.ts delete mode 100644 src/visual-editor/components/left-aside/tabs.ts create mode 100644 src/visual-editor/components/right-attribute-panel/components/form-rule/index.tsx diff --git a/package.json b/package.json index acb29d5..814fd10 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "nprogress": "^1.0.0-1", "qrcode": "^1.4.4", "qs": "^6.10.1", - "vant": "^3.1.2", + "vant": "3.1.2", "vue": "3.1.4", "vue-router": "^4.0.10", "vuedraggable": "^4.0.3", diff --git a/preview/views/comp-render.tsx b/preview/views/comp-render.tsx index b2af262..29bdde9 100644 --- a/preview/views/comp-render.tsx +++ b/preview/views/comp-render.tsx @@ -1,13 +1,14 @@ /* * @Author: 卜启缘 * @Date: 2021-05-04 05:36:58 - * @LastEditTime: 2021-06-25 08:47:18 + * @LastEditTime: 2021-07-04 17:21:34 * @LastEditors: 卜启缘 * @Description: * @FilePath: \vite-vue3-lowcode\preview\views\comp-render.tsx */ import { defineComponent, PropType } from 'vue' import type { VisualEditorBlockData, VisualEditorConfig } from '@/visual-editor/visual-editor.utils' +import { visualConfig } from '@/visual.config' export default defineComponent({ name: 'CompRender', @@ -15,15 +16,11 @@ export default defineComponent({ element: { type: Object as PropType, default: () => ({}) - }, - config: { - type: Object as PropType, - default: () => ({}) } }, setup(props) { return () => - props.config.componentMap[props.element.componentKey].render({ + visualConfig.componentMap[props.element.componentKey].render({ size: {}, props: props.element.props || {}, model: {}, diff --git a/preview/views/preview.vue b/preview/views/preview.vue index f5fd4d1..0f681c5 100644 --- a/preview/views/preview.vue +++ b/preview/views/preview.vue @@ -1,21 +1,21 @@ diff --git a/src/visual-editor/components/left-aside/components/data-source/data-fetch.vue b/src/visual-editor/components/left-aside/components/data-source/data-fetch.vue index d5ec3a6..0b6ae32 100644 --- a/src/visual-editor/components/left-aside/components/data-source/data-fetch.vue +++ b/src/visual-editor/components/left-aside/components/data-source/data-fetch.vue @@ -1,7 +1,7 @@