title |
---|
Button 按钮 |
import { Button } from '@tarojsx/ui'; import { Image } from '@tarojs/components'; import useBaseUrl from '@docusaurus/useBaseUrl'; import dayjs from 'dayjs'; import { UI } from '@/ui';
<Button>default</Button>
<Button type="primary">primary</Button>
<Button type="secondary">secondary</Button>
<Button type="warn">warn</Button>
<Button type="error">error</Button>
<Button size="mini">mini</Button>
<Button size="small">small</Button>
<Button transparent openType="getUserInfo">
<Image src={useBaseUrl('img/logo.svg')} />
</Button>
<UI style={{ display: 'inline-block' }}> <Image src={useBaseUrl('img/logo.svg')} />
<Button clickThrottle>快速点我!</Button>
{time.format(`ss' SSS''`)}
))}
);
}}
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
type | 类型 | default primary secondary warn error |
|
size | 尺寸 | default normal small mini |
|
clickThrottle | onClick 事件节流时间间隔, 单位: ms. | boolean number |
500ms |
transparent | 透明按钮. | boolean |