mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-01-24 04:10:20 +08:00
feat(basic-upload): value
support v-model
This commit is contained in:
parent
76a5f87c0c
commit
16c5d327f1
@ -2,6 +2,7 @@
|
||||
|
||||
- **Axios** 新增`withToken`配置,用于控制请求是否携带 token
|
||||
- **BasicUpload** 新增在预览 `Modal` 中删除文件时触发`preview-delete` 事件
|
||||
- **BasicUpload** `value` 支持 `v-model` 用法
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
||||
name: 'BasicUpload',
|
||||
components: { UploadModal, UploadPreviewModal, Icon, Tooltip },
|
||||
props: uploadContainerProps,
|
||||
emits: ['change', 'delete', 'preview-delete'],
|
||||
emits: ['change', 'delete', 'preview-delete', 'update:value'],
|
||||
|
||||
setup(props, { emit, attrs }) {
|
||||
const { t } = useI18n();
|
||||
@ -85,12 +85,14 @@
|
||||
// 上传modal保存操作
|
||||
function handleChange(urls: string[]) {
|
||||
fileList.value = [...unref(fileList), ...(urls || [])];
|
||||
emit('update:value', fileList.value);
|
||||
emit('change', fileList.value);
|
||||
}
|
||||
|
||||
// 预览modal保存操作
|
||||
function handlePreviewChange(urls: string[]) {
|
||||
fileList.value = [...(urls || [])];
|
||||
emit('update:value', fileList.value);
|
||||
emit('change', fileList.value);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user