-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
590 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: InputNumber 数字输入框 | ||
--- | ||
|
||
## 示例 | ||
|
||
import { InputNumber } from '@tarojsx/ui' | ||
import { UI } from '@/ui' | ||
|
||
```jsx title="整数" | ||
<InputNumber /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [value, setValue] = React.useState(0) | ||
return <InputNumber value={value} onChange={(e) => setValue(e.detail.value)} /> | ||
}} | ||
</UI> | ||
|
||
```jsx title="小数" | ||
<InputNumber step={0.1} /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [value, setValue] = React.useState(0) | ||
return <InputNumber step={0.1} value={value} onChange={(e) => setValue(e.detail.value)} /> | ||
}} | ||
</UI> | ||
|
||
```jsx title="5-8" | ||
<InputNumber min={5} max={8} /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [value, setValue] = React.useState(6) | ||
return <InputNumber min={5} max={8} value={value} onChange={(e) => setValue(e.detail.value)} /> | ||
}} | ||
</UI> | ||
|
||
```jsx title="禁止输入" | ||
<InputNumber disabledInput /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [value, setValue] = React.useState(0) | ||
return <InputNumber disabledInput value={value} onChange={(e) => setValue(e.detail.value)} /> | ||
}} | ||
</UI> | ||
|
||
```jsx title="禁用" | ||
<InputNumber disabled /> | ||
``` | ||
|
||
<UI> | ||
<InputNumber disabled /> | ||
</UI> | ||
|
||
## API | ||
|
||
- [Taro UI 文档](https://taro-ui.jd.com/#/docs/inputnumber) | ||
- [`<InputNumber />`](../modules/_inputnumber_.md) | ||
- [`InputNumberProps`](../interfaces/_inputnumber_.inputnumberprops.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
--- | ||
title: Progress 进度条 | ||
--- | ||
|
||
## 示例 | ||
|
||
import { Progress } from '@tarojsx/ui' | ||
import { useHarmonicIntervalFn } from 'react-use' | ||
import { UI } from '@/ui' | ||
|
||
```jsx title="基础" | ||
<Progress /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [percent, setPercent] = React.useState(0) | ||
useHarmonicIntervalFn(() => setPercent(Math.round((Date.now() / 100) % 100)), 1000) | ||
return <Progress percent={percent} /> | ||
}} | ||
</UI> | ||
|
||
```jsx title="隐藏文字" | ||
<Progress isHidePercent /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [percent, setPercent] = React.useState(0) | ||
useHarmonicIntervalFn(() => setPercent(Math.round((Date.now() / 100) % 100)), 1000) | ||
return <Progress percent={percent} isHidePercent /> | ||
}} | ||
</UI> | ||
|
||
```jsx title="线宽" | ||
<Progress strokeWidth={6} /> | ||
<Progress strokeWidth={8} /> | ||
<Progress strokeWidth={10} /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [percent, setPercent] = React.useState(0) | ||
useHarmonicIntervalFn(() => setPercent(Math.round((Date.now() / 100) % 100)), 1000) | ||
return ( | ||
<div> | ||
<Progress percent={percent} strokeWidth={6} /> | ||
<Progress percent={percent} strokeWidth={8} /> | ||
<Progress percent={percent} strokeWidth={10} /> | ||
</div> | ||
) | ||
}} | ||
</UI> | ||
|
||
```jsx title="过渡时间" | ||
<Progress /> | ||
<Progress transitionDuration={0} /> | ||
<Progress transitionDuration={0.75} /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [percent, setPercent] = React.useState(0) | ||
useHarmonicIntervalFn(() => setPercent(Math.round((Date.now() / 100) % 100)), 1000) | ||
return ( | ||
<div> | ||
<Progress percent={percent} /> | ||
<Progress percent={percent} transitionDuration={0} /> | ||
<Progress percent={percent} transitionDuration={0.75} /> | ||
</div> | ||
) | ||
}} | ||
</UI> | ||
|
||
```jsx title="颜色" | ||
<Progress color='#FF4949' /> | ||
<Progress color='#13CE66' /> | ||
<Progress color='#FFC82C' /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [percent, setPercent] = React.useState(0) | ||
useHarmonicIntervalFn(() => setPercent(Math.round((Date.now() / 100) % 100)), 1000) | ||
return ( | ||
<div> | ||
<Progress percent={percent} color="#FF4949" /> | ||
<Progress percent={percent} color="#13CE66" /> | ||
<Progress percent={percent} color="#FFC82C" /> | ||
</div> | ||
) | ||
}} | ||
</UI> | ||
|
||
```jsx title="状态" | ||
<AtProgress status='error' /> | ||
<AtProgress status='progress' /> | ||
<AtProgress status='success' /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [percent, setPercent] = React.useState(0) | ||
useHarmonicIntervalFn(() => setPercent(Math.round((Date.now() / 100) % 100)), 1000) | ||
return ( | ||
<div> | ||
<Progress percent={percent} status="progress" /> | ||
<Progress percent={percent} status="success" /> | ||
<Progress percent={percent} status="error" /> | ||
</div> | ||
) | ||
}} | ||
</UI> | ||
|
||
## API | ||
|
||
- [Taro UI 文档](https://taro-ui.jd.com/#/docs/progress) | ||
- [`<Progress />`](../modules/_progress_.md) | ||
- [`ProgressProps`](../interfaces/_progress_.progressprops.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: SearchBar 搜索栏 | ||
--- | ||
|
||
## 示例 | ||
|
||
import { SearchBar } from '@tarojsx/ui' | ||
import { UI } from '@/ui' | ||
|
||
```jsx title="基础" | ||
<SearchBar /> | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
return <SearchBar /> | ||
}} | ||
</UI> | ||
|
||
## API | ||
|
||
- [Taro UI 文档](https://taro-ui.jd.com/#/docs/searchbar) | ||
- [`<SearchBar />`](../modules/_searchbar_.md) | ||
- [`SearchBarProps`](../interfaces/_searchbar_.searchbarprops.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
title: Steps 步骤条 | ||
--- | ||
|
||
## 示例 | ||
|
||
import { Steps } from '@tarojsx/ui' | ||
import { UI } from '@/ui' | ||
|
||
```jsx title="基础" | ||
const Demo = () => { | ||
const [current, setCurrent] = React.useState(0) | ||
const onChange = React.useCallback((index) => { | ||
setCurrent(index) | ||
}, []) | ||
return ( | ||
<Steps | ||
items={[ | ||
{ title: '选购' }, | ||
{ | ||
title: '确认', | ||
desc: '这里是额外的信息,最多两行', | ||
icon: { | ||
value: 'shopping-cart', | ||
activeColor: '#fff', | ||
inactiveColor: '#78A4FA', | ||
size: '14', | ||
}, | ||
}, | ||
{ | ||
title: '支付', | ||
icon: { | ||
value: 'credit-card', | ||
activeColor: '#fff', | ||
inactiveColor: '#78A4FA', | ||
size: '14', | ||
}, | ||
}, | ||
{ | ||
title: '完成', | ||
status: 'success', | ||
}, | ||
]} | ||
current={current} | ||
onChange={onChange} | ||
/> | ||
) | ||
} | ||
``` | ||
|
||
<UI> | ||
{() => { | ||
const [current, setCurrent] = React.useState(0) | ||
const onChange = React.useCallback((index) => { | ||
setCurrent(index) | ||
}, []) | ||
return ( | ||
<Steps | ||
items={[ | ||
{ title: '选购' }, | ||
{ | ||
title: '确认', | ||
desc: '这里是额外的信息,最多两行', | ||
icon: { | ||
value: 'shopping-cart', | ||
activeColor: '#fff', | ||
inactiveColor: '#78A4FA', | ||
size: '14', | ||
}, | ||
}, | ||
{ | ||
title: '支付', | ||
icon: { | ||
value: 'credit-card', | ||
activeColor: '#fff', | ||
inactiveColor: '#78A4FA', | ||
size: '14', | ||
}, | ||
}, | ||
{ | ||
title: '完成', | ||
status: 'success', | ||
}, | ||
]} | ||
current={current} | ||
onChange={onChange} | ||
/> | ||
) | ||
}} | ||
</UI> | ||
|
||
## API | ||
|
||
- [Taro UI 文档](https://taro-ui.jd.com/#/docs/steps) | ||
- [`<Steps />`](../modules/_steps_.md) | ||
- [`StepsProps`](../interfaces/_steps_.stepsprops.md) |
Oops, something went wrong.