From 249179ce448bbde7ca86757d4dcd55dced786122 Mon Sep 17 00:00:00 2001 From: bqy_fe <1743369777@qq.com> Date: Sun, 27 Jun 2021 15:14:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=AF=BC=E5=85=A5swagger2.0=E7=89=88=E6=9C=AC=E7=9A=84JSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 3 +- src/main.ts | 4 +- src/packages/base-widgets/button/index.tsx | 4 + src/plugins/element-plus.ts | 13 ++ src/plugins/vant.ts | 2 +- .../components/data-source/data-fetch.vue | 47 +++++--- .../components/data-source/data-model.vue | 52 ++++---- .../components/data-source/index.vue | 6 +- .../components/data-source/utils.tsx | 113 ++++++++++++++++++ .../components/left-aside/index.vue | 36 ++---- src/visual-editor/hooks/useVisualData.ts | 72 +++++------ src/visual-editor/index.vue | 10 +- 12 files changed, 253 insertions(+), 109 deletions(-) create mode 100644 src/visual-editor/components/left-aside/components/data-source/utils.tsx diff --git a/components.d.ts b/components.d.ts index 8144f62..f333c15 100644 --- a/components.d.ts +++ b/components.d.ts @@ -23,9 +23,10 @@ declare module 'vue' { ElInput: typeof import('element-plus/es/el-input')['default'] ElFormItem: typeof import('element-plus/es/el-form-item')['default'] ElForm: typeof import('element-plus/es/el-form')['default'] + ElPopconfirm: typeof import('element-plus/es/el-popconfirm')['default'] ElCollapseItem: typeof import('element-plus/es/el-collapse-item')['default'] ElCollapse: typeof import('element-plus/es/el-collapse')['default'] - ElPopconfirm: typeof import('element-plus/es/el-popconfirm')['default'] + ElInfiniteScroll: typeof import('element-plus/es/el-infinite-scroll')['default'] } } diff --git a/src/main.ts b/src/main.ts index e1a4f60..7227ced 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import { createApp } from 'vue' import App from './App.vue' -import './plugins/element-plus' +import { setupElementPlus } from './plugins/element-plus' import { setupVant } from './plugins/vant' import 'normalize.css' @@ -14,6 +14,8 @@ import store from './store/' const app = createApp(App) +// 使用element-plus插件 +setupElementPlus(app) // 使用vant插件 setupVant(app) diff --git a/src/packages/base-widgets/button/index.tsx b/src/packages/base-widgets/button/index.tsx index 4972a70..76ad758 100644 --- a/src/packages/base-widgets/button/index.tsx +++ b/src/packages/base-widgets/button/index.tsx @@ -87,6 +87,10 @@ export default { { label: '表单提交按钮', value: 'submit' + }, + { + label: '表单重置按钮', + value: 'reset' } ], defaultValue: 'button' diff --git a/src/plugins/element-plus.ts b/src/plugins/element-plus.ts index 10b0db0..9e6a3d3 100644 --- a/src/plugins/element-plus.ts +++ b/src/plugins/element-plus.ts @@ -1,3 +1,16 @@ +/* + * @Author: 卜启缘 + * @Date: 2021-04-22 02:10:31 + * @LastEditTime: 2021-06-27 14:58:03 + * @LastEditors: 卜启缘 + * @Description: 按需导入element-plus + * @FilePath: \vite-vue3-lowcode\src\plugins\element-plus.ts + */ import 'element-plus/packages/theme-chalk/src/base.scss' // import 'element-plus/lib/theme-chalk/index.css' // import 'element-plus/lib/theme-chalk/el-popper.css' +import type { App } from 'vue' +import { ElInfiniteScroll } from 'element-plus' +export const setupElementPlus = (app: App) => { + app.use(ElInfiniteScroll) +} diff --git a/src/plugins/vant.ts b/src/plugins/vant.ts index 01e67e0..05a26b3 100644 --- a/src/plugins/vant.ts +++ b/src/plugins/vant.ts @@ -1,4 +1,4 @@ -import { App } from 'vue' +import type { App } from 'vue' import '@vant/touch-emulator' import 'vant/lib/index.css' 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 6d5fb73..5c13bb1 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 @@