Skip to content

Commit

Permalink
docs(export): add export func docs (#865)
Browse files Browse the repository at this point in the history
* docs: add export func docs

* docs: move docs

Co-authored-by: wengyidong.wyd <[email protected]>
  • Loading branch information
YardWill and YardWill authored Dec 6, 2021
1 parent c49fa9f commit 3162549
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions s2-site/docs/api/components/export.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,35 @@ order: 5
| successText | 操作成功文案 | `string` | | |
| errorText | 操作失败文案 | `string` | | |
| fileName | 自定义下载文件名 | `string` | sheet | |

## 原始导出方法

```tsx
import { copyData, copyToClipboard, download} from '@antv/s2'

const data = copyData(spreadsheet, '\t', false)

copyToClipboard(data)
download(data, 'filename')
```

### copyData

| 参数 | 说明 | 类型 | 默认值 | 必选 |
| :---------- | :---------- | :--------------- | :------ | :---- |
| spreadsheet | s2实例 | `SpreadSheet` | ||
| split | 分隔符 | `string` | ||
| isFormat | 是否格式化 | `boolean` | false | |

### copyToClipboard

| 参数 | 说明 | 类型 | 默认值 | 必选 |
| :---------- | :---------- | :--------------- | :------ | :---- |
| data | 拷贝数据 | `string` | ||

### download

| 参数 | 说明 | 类型 | 默认值 | 必选 |
| :---------- | :---------- | :--------------- | :------ | :---- |
| data | 拷贝数据 | `string` | ||
| filename | 文件名称 | `string` | ||
32 changes: 32 additions & 0 deletions s2-site/docs/manual/basic/analysis/export.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,35 @@ const s2options = {
点击复制或下载按钮,导出全量数据(全量复制)

![导出](https://gw.alipayobjects.com/mdn/rms_56cbb2/afts/img/A*d0CqRY6M3yMAAAAAAAAAAAAAARQnAQ)

## 原始导出方法

```tsx
import { copyData, copyToClipboard, download} from '@antv/s2'

const data = copyData(spreadsheet, '\t', false)

copyToClipboard(data)
download(data, 'filename')
```

### copyData

| 参数 | 说明 | 类型 | 默认值 | 必选 |
| :---------- | :---------- | :--------------- | :------ | :---- |
| spreadsheet | s2实例 | `SpreadSheet` | ||
| split | 分隔符 | `string` | ||
| isFormat | 是否格式化 | `boolean` | false | |

### copyToClipboard

| 参数 | 说明 | 类型 | 默认值 | 必选 |
| :---------- | :---------- | :--------------- | :------ | :---- |
| data | 拷贝数据 | `string` | ||

### download

| 参数 | 说明 | 类型 | 默认值 | 必选 |
| :---------- | :---------- | :--------------- | :------ | :---- |
| data | 拷贝数据 | `string` | ||
| filename | 文件名称 | `string` | ||

0 comments on commit 3162549

Please sign in to comment.