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