feat: 上传list-type
This commit is contained in:
32
apps/web-antd/src/views/演示使用自行删除/upload/hook.ts
Normal file
32
apps/web-antd/src/views/演示使用自行删除/upload/hook.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
export function useImageType() {
|
||||
const imageListTypes = ['text', 'picture', 'picture-card'] as const;
|
||||
const imageListOptions = imageListTypes.map((str) => ({
|
||||
label: str,
|
||||
value: str,
|
||||
}));
|
||||
|
||||
const currentImageListType =
|
||||
ref<(typeof imageListTypes)[number]>('picture-card');
|
||||
|
||||
return {
|
||||
imageListOptions,
|
||||
currentImageListType,
|
||||
};
|
||||
}
|
||||
|
||||
export function useFileType() {
|
||||
const fileListTypes = ['text', 'picture'] as const;
|
||||
const fileListOptions = fileListTypes.map((str) => ({
|
||||
label: str,
|
||||
value: str,
|
||||
}));
|
||||
|
||||
const currentFileListType = ref<(typeof fileListTypes)[number]>('text');
|
||||
|
||||
return {
|
||||
fileListOptions,
|
||||
currentFileListType,
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user