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