diff --git a/packages/mini-demo/src/pages/radio/component/basic.tsx b/packages/mini-demo/src/pages/radio/component/basic.tsx new file mode 100644 index 000000000..8d7d0f900 --- /dev/null +++ b/packages/mini-demo/src/pages/radio/component/basic.tsx @@ -0,0 +1,27 @@ +import * as React from 'react'; +import { List, Panel, Radio } from 'zarm/mini'; + +const Demo = () => { + return ( + + + + 普通 + + + 默认选中 + + + 禁用 + + + + 选中且禁用 + + + + + ); +}; + +export default Demo; diff --git a/packages/mini-demo/src/pages/radio/component/button.tsx b/packages/mini-demo/src/pages/radio/component/button.tsx new file mode 100644 index 000000000..41fccbfc5 --- /dev/null +++ b/packages/mini-demo/src/pages/radio/component/button.tsx @@ -0,0 +1,39 @@ +import * as React from 'react'; +import { List, Panel, Radio } from 'zarm/mini'; + +const Demo = () => { + return ( + + + + 选项一 + 选项二 + 选项三 + + + + + 选项一 + 选项二 + 选项三 + + + + + 选项一 + 选项二 + 选项三 + + + + + 选项一 + 选项二 + 选项三 + + + + ); +}; + +export default Demo; diff --git a/packages/mini-demo/src/pages/radio/component/group.tsx b/packages/mini-demo/src/pages/radio/component/group.tsx new file mode 100644 index 000000000..78c0f2b32 --- /dev/null +++ b/packages/mini-demo/src/pages/radio/component/group.tsx @@ -0,0 +1,27 @@ +import * as React from 'react'; +import { List, Panel, Radio } from 'zarm/mini'; + +const Demo = () => { + const [value, setValue] = React.useState([]); + + const onChange = (val) => { + console.log('onChange', val); + setValue(val); + }; + + return ( + + + + + 选项一 + 选项二 + 选项三 + + + + + ); +}; + +export default Demo; diff --git a/packages/mini-demo/src/pages/radio/component/list.tsx b/packages/mini-demo/src/pages/radio/component/list.tsx new file mode 100644 index 000000000..4d6c30e9b --- /dev/null +++ b/packages/mini-demo/src/pages/radio/component/list.tsx @@ -0,0 +1,28 @@ +import * as React from 'react'; +import { List, Panel, Radio } from 'zarm/mini'; + +const Demo = () => { + return ( + <> + + + 选项一 + 选项二 + + 选项三(禁止选择) + + + + + + + 选项一 + 选项二 + + + + + ); +}; + +export default Demo; diff --git a/packages/mini-demo/src/pages/radio/index.tsx b/packages/mini-demo/src/pages/radio/index.tsx index 17adfe7be..c833f9816 100644 --- a/packages/mini-demo/src/pages/radio/index.tsx +++ b/packages/mini-demo/src/pages/radio/index.tsx @@ -1,91 +1,17 @@ -import { View } from '@tarojs/components'; import * as React from 'react'; -import { List, Radio } from 'zarm/mini'; +import Basic from './component/basic'; +import Button from './component/button'; +import Group from './component/group'; +import List from './component/list'; import './index.scss'; -const Demo = () => { - const [value, setValue] = React.useState([]); - - const onChange = (value) => { - console.log('onChange', value); - setValue(value); - }; - +export default () => { return ( - - 基本用法 - - - 普通 - - - 默认选中 - - - 禁用 - - - - 选中且禁用 - - - - 组合使用 - - - - 选项一 - 选项二 - 选项三 - - - - 列表样式 - - 选项一 - 选项二 - - 选项三(禁止选择) - - - 通栏样式 - - - 选项一 - 选项二 - - - 按钮样式 - - - 选项一 - 选项二 - 选项三 - - - - - 选项一 - 选项二 - 选项三 - - - - - 选项一 - 选项二 - 选项三 - - - - - 选项一 - 选项二 - 选项三 - - - + <> + + + +