40 lines
975 B
TypeScript
40 lines
975 B
TypeScript
/*
|
|
* @Author: zhaojinfeng 121016171@qq.com
|
|
* @Date: 2023-07-21 12:25:52
|
|
* @LastEditors: zhaojinfeng 121016171@qq.com
|
|
* @LastEditTime: 2023-07-23 01:43:20
|
|
* @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({
|
|
url: avatar,
|
|
}),
|
|
},
|
|
} satisfies Meta<typeof ThDownloadLink>
|
|
export default meta
|
|
|
|
type Story = StoryObj<typeof meta>
|
|
|
|
export const Base: Story = {
|
|
name: '基本使用',
|
|
}
|