41 lines
1013 B
TypeScript
41 lines
1013 B
TypeScript
/*
|
|
* @Author: zhaojinfeng 121016171@qq.com
|
|
* @Date: 2023-07-21 12:25:52
|
|
* @LastEditors: peerless_hero peerless_hero@outlook.com
|
|
* @LastEditTime: 2023-08-30 15:33:53
|
|
* @FilePath: \vue3\stories\DownloadLink.stories.ts
|
|
* @Description:
|
|
*
|
|
*/
|
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
import ThDownloadLink from '../packages/download-link/index.vue'
|
|
import avatar from './assets/avatar.jpeg'
|
|
|
|
const meta = {
|
|
title: '数据展示/DownloadLink',
|
|
component: ThDownloadLink,
|
|
tags: ['autodocs'],
|
|
args: {
|
|
fileName: '文件名',
|
|
/**
|
|
* 下载文件的请求源
|
|
*
|
|
* 可以是文件名或URL。
|
|
*
|
|
*/
|
|
src: 'https://www.bingimg.cn/down/OHR.TeaEstate_ZH-CN9645412630_1920x1080.jpg',
|
|
/** 文件信息请求函数 */
|
|
request: () => Promise.resolve({
|
|
name: 'avatar.jpeg',
|
|
url: avatar,
|
|
}),
|
|
},
|
|
} satisfies Meta<typeof ThDownloadLink>
|
|
export default meta
|
|
|
|
type Story = StoryObj<typeof meta>
|
|
|
|
export const Base: Story = {
|
|
name: '基本使用',
|
|
}
|