Commit a12c5706e8da2fa935e5ab56e95775b47f25c8ce

Authored by 前端爱码士
Committed by GitHub
1 parent 6fa35521

fix: 修复props默认字段default返回空对象语法问题 (#2369)

src/components/Form/src/props.ts
@@ -9,7 +9,7 @@ import { propTypes } from '/@/utils/propTypes'; @@ -9,7 +9,7 @@ import { propTypes } from '/@/utils/propTypes';
9 export const basicProps = { 9 export const basicProps = {
10 model: { 10 model: {
11 type: Object as PropType<Recordable>, 11 type: Object as PropType<Recordable>,
12 - default: {}, 12 + default: () => ({}),
13 }, 13 },
14 // 标签宽度 固定宽度 14 // 标签宽度 固定宽度
15 labelWidth: { 15 labelWidth: {
src/components/Menu/src/props.ts
@@ -41,7 +41,7 @@ export const basicProps = { @@ -41,7 +41,7 @@ export const basicProps = {
41 export const itemProps = { 41 export const itemProps = {
42 item: { 42 item: {
43 type: Object as PropType<Menu>, 43 type: Object as PropType<Menu>,
44 - default: {}, 44 + default: () => ({}),
45 }, 45 },
46 level: propTypes.number, 46 level: propTypes.number,
47 theme: propTypes.oneOf(['dark', 'light']), 47 theme: propTypes.oneOf(['dark', 'light']),
src/components/Tinymce/src/Editor.vue
@@ -76,7 +76,7 @@ @@ -76,7 +76,7 @@
76 const tinymceProps = { 76 const tinymceProps = {
77 options: { 77 options: {
78 type: Object as PropType<Partial<RawEditorSettings>>, 78 type: Object as PropType<Partial<RawEditorSettings>>,
79 - default: {}, 79 + default: () => ({}),
80 }, 80 },
81 value: { 81 value: {
82 type: String, 82 type: String,
src/components/Upload/src/props.ts
@@ -27,7 +27,7 @@ export const basicProps = { @@ -27,7 +27,7 @@ export const basicProps = {
27 }, 27 },
28 uploadParams: { 28 uploadParams: {
29 type: Object as PropType<any>, 29 type: Object as PropType<any>,
30 - default: {}, 30 + default: () => ({}),
31 }, 31 },
32 api: { 32 api: {
33 type: Function as PropType<PromiseFn>, 33 type: Function as PropType<PromiseFn>,
src/components/Verify/src/props.ts
@@ -38,19 +38,19 @@ export const basicProps = { @@ -38,19 +38,19 @@ export const basicProps = {
38 38
39 wrapStyle: { 39 wrapStyle: {
40 type: Object as PropType<any>, 40 type: Object as PropType<any>,
41 - default: {}, 41 + default: () => ({}),
42 }, 42 },
43 contentStyle: { 43 contentStyle: {
44 type: Object as PropType<any>, 44 type: Object as PropType<any>,
45 - default: {}, 45 + default: () => ({}),
46 }, 46 },
47 barStyle: { 47 barStyle: {
48 type: Object as PropType<any>, 48 type: Object as PropType<any>,
49 - default: {}, 49 + default: () => ({}),
50 }, 50 },
51 actionStyle: { 51 actionStyle: {
52 type: Object as PropType<any>, 52 type: Object as PropType<any>,
53 - default: {}, 53 + default: () => ({}),
54 }, 54 },
55 }; 55 };
56 56
@@ -67,7 +67,7 @@ export const rotateProps = { @@ -67,7 +67,7 @@ export const rotateProps = {
67 67
68 imgWrapStyle: { 68 imgWrapStyle: {
69 type: Object as PropType<any>, 69 type: Object as PropType<any>,
70 - default: {}, 70 + default: () => ({}),
71 }, 71 },
72 72
73 minDegree: { 73 minDegree: {