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