feat: 禁用功能
This commit is contained in:
@ -2,13 +2,13 @@
|
||||
* @Author: zhaojinfeng 121016171@qq.com
|
||||
* @Date: 2023-08-16 17:33:41
|
||||
* @LastEditors: zhaojinfeng 121016171@qq.com
|
||||
* @LastEditTime: 2023-08-16 18:23:17
|
||||
* @LastEditTime: 2023-08-16 18:32:13
|
||||
* @FilePath: \vue3\packages\upload-list\index.vue
|
||||
* @Description:
|
||||
*
|
||||
-->
|
||||
<template>
|
||||
<el-upload v-model:file-list="value" :accept="accept" :http-request="httpRequest">
|
||||
<el-upload v-model:file-list="value" :accept="accept" :disabled="disabled" :http-request="httpRequest">
|
||||
<el-button type="primary" plain>
|
||||
点击上传
|
||||
</el-button>
|
||||
@ -28,6 +28,8 @@ const props = withDefaults(
|
||||
request: (formData: FormData, args?: any) => Promise<FileVO>
|
||||
/** 自定义文件上传路径前缀 */
|
||||
filePath?: string
|
||||
/** 禁用组件 */
|
||||
disabled?: boolean
|
||||
}>(), {
|
||||
fileList: () => [],
|
||||
},
|
||||
|
@ -31,6 +31,7 @@ const meta = {
|
||||
component: ThUploadList,
|
||||
args: {
|
||||
accept: '*',
|
||||
disabled: false,
|
||||
fileList: [],
|
||||
request,
|
||||
filePath: '/',
|
||||
@ -44,3 +45,16 @@ type Story = StoryObj<typeof meta>
|
||||
export const Base: Story = {
|
||||
name: '基本使用',
|
||||
}
|
||||
|
||||
export const Disabled: Story = {
|
||||
name: '禁用',
|
||||
args: {
|
||||
disabled: true,
|
||||
fileList: [{
|
||||
id: Date.now(),
|
||||
name: avatar,
|
||||
url: avatar,
|
||||
createdBy: 'user',
|
||||
}],
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user