Commit 16c5d327f1209f7c7437acde2ab0fa031da6a641
1 parent
76a5f87c
feat(basic-upload): `value` support v-model
Showing
2 changed files
with
4 additions
and
1 deletions
CHANGELOG.zh_CN.md
src/components/Upload/src/BasicUpload.vue
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | name: 'BasicUpload', |
52 | 52 | components: { UploadModal, UploadPreviewModal, Icon, Tooltip }, |
53 | 53 | props: uploadContainerProps, |
54 | - emits: ['change', 'delete', 'preview-delete'], | |
54 | + emits: ['change', 'delete', 'preview-delete', 'update:value'], | |
55 | 55 | |
56 | 56 | setup(props, { emit, attrs }) { |
57 | 57 | const { t } = useI18n(); |
... | ... | @@ -85,12 +85,14 @@ |
85 | 85 | // 上传modal保存操作 |
86 | 86 | function handleChange(urls: string[]) { |
87 | 87 | fileList.value = [...unref(fileList), ...(urls || [])]; |
88 | + emit('update:value', fileList.value); | |
88 | 89 | emit('change', fileList.value); |
89 | 90 | } |
90 | 91 | |
91 | 92 | // 预览modal保存操作 |
92 | 93 | function handlePreviewChange(urls: string[]) { |
93 | 94 | fileList.value = [...(urls || [])]; |
95 | + emit('update:value', fileList.value); | |
94 | 96 | emit('change', fileList.value); |
95 | 97 | } |
96 | 98 | ... | ... |