From eeb0065d803ec90bfb26769fd34e5b428b52109f Mon Sep 17 00:00:00 2001 From: vdpAdmin Date: Sat, 29 Jan 2022 19:49:51 +0800 Subject: [PATCH] =?UTF-8?q?2022.01.29=EF=BC=8C=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86bug=EF=BC=8C=E5=87=86=E5=A4=87=E5=8F=91=E5=B8=833.0?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=89=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install-render.js | 7 +- install.js | 7 +- package.json | 2 +- .../field-widget/button-widget.vue | 2 +- .../field-widget/cascader-widget.vue | 2 +- .../field-widget/checkbox-widget.vue | 2 +- .../form-widget/field-widget/color-widget.vue | 2 +- .../field-widget/date-range-widget.vue | 2 +- .../form-widget/field-widget/date-widget.vue | 2 +- .../form-widget/field-widget/fieldMixin.js | 4 - .../form-widget/field-widget/input-widget.vue | 2 +- .../form-widget/field-widget/radio-widget.vue | 2 +- .../field-widget/select-widget.vue | 2 +- .../field-widget/textarea-widget.vue | 2 +- .../field-widget/time-range-widget.vue | 2 +- .../form-widget/field-widget/time-widget.vue | 2 +- .../setting-panel/property-editor-factory.jsx | 2 +- .../property-editor/allowCreate-editor.vue | 2 +- .../property-editor/appendButton-editor.vue | 2 +- .../appendButtonDisabled-editor.vue | 2 +- .../property-editor/autoFullWidth-editor.vue | 2 +- .../automaticDropdown-editor.vue | 2 +- .../property-editor/border-editor.vue | 2 +- .../property-editor/buttonStyle-editor.vue | 2 +- .../property-editor/clearable-editor.vue | 2 +- .../grid-col-responsive-editor.vue | 2 +- .../showBlankRow-editor.vue | 2 +- .../showRowNumber-editor.vue | 2 +- .../property-editor/disabled-editor.vue | 2 +- .../property-editor/editable-editor.vue | 2 +- .../field-button/circle-editor.vue | 2 +- .../field-button/plain-editor.vue | 2 +- .../field-button/round-editor.vue | 2 +- .../field-rate/allowHalf-editor.vue | 2 +- .../field-rate/showScore-editor.vue | 2 +- .../field-rate/showText-editor.vue | 2 +- .../field-slider/range-editor.vue | 2 +- .../field-slider/showStops-editor.vue | 2 +- .../field-slider/vertical-editor.vue | 2 +- .../property-editor/filterable-editor.vue | 2 +- .../property-editor/hidden-editor.vue | 2 +- .../property-editor/labelHidden-editor.vue | 2 +- .../property-editor/multiple-editor.vue | 2 +- .../property-editor/multipleSelect-editor.vue | 2 +- .../property-editor/readonly-editor.vue | 2 +- .../property-editor/remote-editor.vue | 2 +- .../property-editor/required-editor.vue | 2 +- .../property-editor/showFileList-editor.vue | 2 +- .../property-editor/showPassword-editor.vue | 2 +- .../property-editor/showWordLimit-editor.vue | 2 +- .../withCredentials-editor.vue | 2 +- .../form-designer/toolbar-panel/index.vue | 4 + src/utils/code-generator.js | 73 +++++++++---------- vite-lib-render.config.js | 5 +- vite-lib.config.js | 2 +- 55 files changed, 96 insertions(+), 102 deletions(-) diff --git a/install-render.js b/install-render.js index 563eab6..3b3de8d 100644 --- a/install-render.js +++ b/install-render.js @@ -32,10 +32,9 @@ const install = (app) => { }) } -// if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时主动调用install方法!! */ -// window.axios = axios -// install(window.Vue); -// } +if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时赋值axios!! */ + window.axios = axios +} export default { install, diff --git a/install.js b/install.js index 1e09ad9..3252f12 100644 --- a/install.js +++ b/install.js @@ -62,10 +62,9 @@ const install = (app) => { }) } -// if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时主动调用install方法!! */ -// window.axios = axios -// install(window.Vue); -// } +if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时赋值axios!! */ + window.axios = axios +} export default { install, diff --git a/package.json b/package.json index f8d6553..3da2efc 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "axios": "^0.24.0", "clipboard": "^2.0.8", "core-js": "^3.6.5", - "element-plus": "^1.3.0-beta.3", + "element-plus": "^1.3.0-beta.9", "file-saver": "^2.0.5", "mitt": "^3.0.0", "sortablejs": "1.14.0", diff --git a/src/components/form-designer/form-widget/field-widget/button-widget.vue b/src/components/form-designer/form-widget/field-widget/button-widget.vue index edbfdcb..21a1f61 100644 --- a/src/components/form-designer/form-widget/field-widget/button-widget.vue +++ b/src/components/form-designer/form-widget/field-widget/button-widget.vue @@ -2,7 +2,7 @@ - -` diff --git a/vite-lib-render.config.js b/vite-lib-render.config.js index ba2f137..3575093 100644 --- a/vite-lib-render.config.js +++ b/vite-lib-render.config.js @@ -14,7 +14,8 @@ export default defineConfig({ vueJsx({}), //解决引入commonjs模块后打包出现的{'default' is not exported by XXX}错误!! - commonjs(), + commonjs({requireReturnsDefault: true}), /* 配置requireReturnsDefault属性, + 解决打包后引入VForm出现的"Axios is not a constructor"错!! */ viteSvgIcons({ // Specify the icon folder to be cached @@ -50,7 +51,7 @@ export default defineConfig({ lib: { entry: resolve(__dirname, 'install-render.js'), name: 'VFormRender', - fileName: (format) => `VFormRender.${format}.js` + fileName: (format) => `render.${format}.js` }, rollupOptions: { // 确保外部化处理那些你不想打包进库的依赖 diff --git a/vite-lib.config.js b/vite-lib.config.js index 291cf8b..c47dd12 100644 --- a/vite-lib.config.js +++ b/vite-lib.config.js @@ -55,7 +55,7 @@ export default defineConfig({ lib: { entry: resolve(__dirname, 'install.js'), name: 'VFormDesigner', - fileName: (format) => `VFormDesigner.${format}.js` + fileName: (format) => `designer.${format}.js` }, rollupOptions: { // 确保外部化处理那些你不想打包进库的依赖