Skip to content

Commit

Permalink
docs: update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
cncolder committed Jul 14, 2020
1 parent 1191544 commit bda9675
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
32 changes: 31 additions & 1 deletion docs/antv-f2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sidebar_label: AntV F2

### 使用

```jsx
```jsx title="默认全量导入 F2"
import React from 'react'
import { F2 } from '@tarojsx/library/dist/antv'

Expand Down Expand Up @@ -47,6 +47,27 @@ const Demo = () => {
}
```

```jsx title="按需引用 F2"
import React from 'react'
import { Chart, Global } from '@antv/f2/es/core'
import { F2Core } from '@tarojsx/library/dist/antv/F2Core'

require('@antv/f2/es/coord/polar')
require('@antv/f2/es/component/guide/text')
Chart.plugins.register(require('@antv/f2/es/plugin/guide'))

const Demo = () => {
return (
<F2Core style={{ width: '100vw', height: '50vh' }} config={{ Chart, Global }} data={[]}>
{({ chart, data }) => {
chart.source(data)
chart.render()
}}
</F2Core>
)
}
```

import { F2 } from '@tarojsx/library/dist/antv'
import { UI } from '@/ui'

Expand All @@ -72,3 +93,12 @@ import { UI } from '@/ui'
)
}}
</UI>

| 参数 | 说明 | 类型 | 默认值 |
| ----------- | ----------------------------------------------------------------------------------------- | ------------------------- | ------ |
| className? | | string | |
| style? | | {} | |
| config? | 图表配置, [参考 Chart](https://f2.antv.vision/zh/docs/api/chart/chart#%E5%8F%82%E6%95%B0) | `{}` | |
| data | 图表数据 | `[]` | |
| fontFamily? | 字体 | `string` | |
| children | 图表渲染逻辑 | `({chart, data}) => void` | |
10 changes: 10 additions & 0 deletions docs/react-use-gesture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,13 @@ import { UI } from '@/ui'
)
}}
</UI>

| 参数 | 说明 | 类型 | 默认值 |
| ---- | ----------- | ------ | ------ |
| id? | 容器元素 ID | string | uuid |
| ref? | React ref | | |

| 返回值 | 说明 | 类型 |
| ------ | ---------------------------------------------------- | ---- |
| [0] | gestureConfig: 传给 `react-use-gesture` hooks 的配置 | {} |
| [1] | containerProps: 需要绑定在容器元素上的属性 | |

0 comments on commit bda9675

Please sign in to comment.