FileCard 文件卡片#
代码演示#
import React from 'react';
import { FileCard } from '@chatui/core';
export default function() {
const file = {
name: 'myFile.zip',
size: 12345,
};
return (
<div>
<h3>基础用法</h3>
<FileCard file={file} />
<h3>指定拓展名</h3>
<FileCard file={file} extension="pdf" />
<h3>额外内容</h3>
<FileCard file={file}>
<a href="#">下载</a>
</FileCard>
</div>
);
}
Props#
FileCard#
参数 | 类型 | 默认值 | 说明 |
---|---|---|---|
className | string | ||
file | object | 文件对象 | |
extension | string | 拓展名,默认从 file.name 中提取 |
|
children | node |