-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
王梦良
authored and
王梦良
committed
Aug 29, 2023
1 parent
92958c0
commit d181aa6
Showing
10 changed files
with
160 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
import { List, Panel, Radio } from 'zarm/mini'; | ||
|
||
const Demo = () => { | ||
return ( | ||
<Panel title="基本用法"> | ||
<List> | ||
<List.Item> | ||
<Radio>普通</Radio> | ||
</List.Item> | ||
<List.Item> | ||
<Radio defaultChecked>默认选中</Radio> | ||
</List.Item> | ||
<List.Item> | ||
<Radio disabled>禁用</Radio> | ||
</List.Item> | ||
<List.Item> | ||
<Radio defaultChecked disabled> | ||
选中且禁用 | ||
</Radio> | ||
</List.Item> | ||
</List> | ||
</Panel> | ||
); | ||
}; | ||
|
||
export default Demo; |
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,39 @@ | ||
import * as React from 'react'; | ||
import { List, Panel, Radio } from 'zarm/mini'; | ||
|
||
const Demo = () => { | ||
return ( | ||
<Panel title="按钮样式"> | ||
<List.Item title="普通"> | ||
<Radio.Group type="button"> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
<List.Item title="禁用"> | ||
<Radio.Group type="button" disabled> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
<List.Item title="通栏"> | ||
<Radio.Group type="button" block> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
<List.Item title="紧凑"> | ||
<Radio.Group type="button" compact> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
</Panel> | ||
); | ||
}; | ||
|
||
export default Demo; |
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,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 ( | ||
<Panel title="组合使用"> | ||
<List> | ||
<List.Item> | ||
<Radio.Group value={value} onChange={onChange}> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
</List> | ||
</Panel> | ||
); | ||
}; | ||
|
||
export default Demo; |
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,28 @@ | ||
import * as React from 'react'; | ||
import { List, Panel, Radio } from 'zarm/mini'; | ||
|
||
const Demo = () => { | ||
return ( | ||
<> | ||
<Panel title="列表样式"> | ||
<Radio.Group type="list"> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2" disabled> | ||
选项三(禁止选择) | ||
</Radio> | ||
</Radio.Group> | ||
</Panel> | ||
<Panel title="通栏样式"> | ||
<List.Item> | ||
<Radio.Group block> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
</Panel> | ||
</> | ||
); | ||
}; | ||
|
||
export default Demo; |
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 |
---|---|---|
@@ -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 ( | ||
<View style={{ padding: 20 }}> | ||
<View>基本用法</View> | ||
<List> | ||
<List.Item> | ||
<Radio>普通</Radio> | ||
</List.Item> | ||
<List.Item> | ||
<Radio defaultChecked>默认选中</Radio> | ||
</List.Item> | ||
<List.Item> | ||
<Radio disabled>禁用</Radio> | ||
</List.Item> | ||
<List.Item> | ||
<Radio defaultChecked disabled> | ||
选中且禁用 | ||
</Radio> | ||
</List.Item> | ||
</List> | ||
<View>组合使用</View> | ||
<List> | ||
<List.Item> | ||
<Radio.Group value={value} onChange={onChange}> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
</List> | ||
<View>列表样式</View> | ||
<Radio.Group type="list"> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2" disabled> | ||
选项三(禁止选择) | ||
</Radio> | ||
</Radio.Group> | ||
<View>通栏样式</View> | ||
<List.Item> | ||
<Radio.Group block> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
<View>按钮样式</View> | ||
<List.Item title="普通"> | ||
<Radio.Group type="button"> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
<List.Item title="禁用"> | ||
<Radio.Group type="button" disabled> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
<List.Item title="通栏"> | ||
<Radio.Group type="button" block> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
<List.Item title="紧凑"> | ||
<Radio.Group type="button" compact> | ||
<Radio value="0">选项一</Radio> | ||
<Radio value="1">选项二</Radio> | ||
<Radio value="2">选项三</Radio> | ||
</Radio.Group> | ||
</List.Item> | ||
</View> | ||
<> | ||
<Basic /> | ||
<Group /> | ||
<List /> | ||
<Button /> | ||
</> | ||
); | ||
}; | ||
|
||
export default Demo; |
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
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import '../../button/style/index.mini'; | ||
import '../../icon/style'; | ||
import '../../list/style'; | ||
import '../../list/style/index.mini'; | ||
import '../../style'; | ||
import './index.scss'; |