Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/sites/demos/apis/pop-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default {
},
{
name: 'size',
type: 'string',
type: `'large' | 'medium' | 'small' | 'mini'`,
defaultValue: '',
desc: {
'zh-CN': '设置组件大小',
Expand Down
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/pop-upload/webdoc/pop-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
},
desc: {
'zh-CN':
'通过 <code>medium</code>,<code>small</code>,<code>mini</code> 设置组件尺寸,<code>disabled</code> 设置是否禁用,默认值为 false。',
'通过 <code>large</code>,<code>medium</code>,<code>small</code>,<code>mini</code> 设置组件尺寸,<code>disabled</code> 设置是否禁用,默认值为 false。',
'en-US':
'Set the component size through<code>media</code>,<code>small</code>,<code>mini</code>, and whether to <code>disabled</code> it. The default value is false.'
},
Comment on lines +43 to 46
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

The English description needs to be updated to include the 'large' option

While the Chinese description has been correctly updated to include the 'large' option, the English description still only mentions 'media', 'small', and 'mini', which is inconsistent.

Apply this diff to fix the inconsistency:

        'en-US':
-          'Set the component size through<code>media</code>,<code>small</code>,<code>mini</code>, and whether to <code>disabled</code> it. The default value is false.'
+          'Set the component size through<code>large</code>,<code>media</code>,<code>small</code>,<code>mini</code>, and whether to <code>disabled</code> it. The default value is false.'

Additionally, there's a typo in the English description - it should be medium instead of media.

Committable suggestion skipped: line range outside the PR's diff.

Expand Down Expand Up @@ -189,11 +189,11 @@ export default {
support: {
value: true
},
description: '通过 medium、small、mini 设置组件尺寸,disabled 设置是否禁用。',
description: '通过 large、medium、small、mini 设置组件尺寸,disabled 设置是否禁用。',
cloud: {
value: false
},
apis: ['medium', 'small', 'mini', 'disabled'],
apis: ['large', 'medium', 'small', 'mini', 'disabled'],
demos: ['size']
},
{
Expand Down
8 changes: 7 additions & 1 deletion packages/vue/src/pop-upload/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ export default defineComponent({
type: Object,
default: () => $constants
},
size: String,
size: {
type: String,
default: '',
validator(val: string) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of a validator for the size property is a good practice to ensure that only valid size options are used. This helps prevent potential errors from invalid input.

return ['large', 'medium', 'small', 'mini', ''].includes(val)
}
},
data: Object,
uploadName: String,
dialogTitle: {
Expand Down
Loading