-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(radio): 重构radio dom接口,补充对应文档和适配样式
fix #461
- Loading branch information
Showing
28 changed files
with
2,304 additions
and
315 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
Submodule _common
updated
3 files
+35 −0 | docs/mobile/api/radio.en-US.md | |
+23 −5 | docs/mobile/api/radio.md | |
+1 −1 | style/mobile/components/radio/v2/_index.less |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { useState } from 'react'; | ||
import { Radio, RadioGroup } from 'tdesign-mobile-react'; | ||
|
||
export default function () { | ||
const [defaultValue, setDefaultValue] = useState('1'); | ||
const options = [ | ||
{ | ||
value: '1', | ||
label: '单选', | ||
}, | ||
{ | ||
value: '2', | ||
label: '单选', | ||
}, | ||
{ | ||
value: '3', | ||
label: '单选标题多行单选标题多行单选标题多行单选标题多行单选标题多行', | ||
}, | ||
]; | ||
return ( | ||
<RadioGroup className="theme-card" value={defaultValue} onChange={setDefaultValue}> | ||
{options.map((opt) => <Radio value={opt.value} label={opt.label} key={opt.value}></Radio>)} | ||
</RadioGroup> | ||
); | ||
} |
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 React, { useState } from 'react'; | ||
import { Radio, RadioGroup } from 'tdesign-mobile-react'; | ||
import { Icon } from 'tdesign-icons-react'; | ||
import TDemoBlock from '../../../site/mobile/components/DemoBlock'; | ||
|
||
export default function () { | ||
const [defaultValue, setDefaultValue] = useState(0); | ||
const [defaultValueH, setDefaultValueH] = useState(0); | ||
return ( | ||
<> | ||
<TDemoBlock summary="单选框尺寸规格"> | ||
<RadioGroup value={defaultValue} onChange={(value) => setDefaultValue(value)}> | ||
{Array.from(Array(3), (_, key) => ( | ||
<div className={`card ${defaultValue === key ? 'card--active' : ''}`} key={key}> | ||
{defaultValue === key && <Icon name="check" color="#fff" className="card__icon" />} | ||
<Radio | ||
value={key} | ||
borderless | ||
label="单选" | ||
content="描述信息描述信息描述信息描述信息描述信息" | ||
icon="none" | ||
></Radio> | ||
</div> | ||
))} | ||
</RadioGroup> | ||
</TDemoBlock> | ||
<TDemoBlock summary="横向卡片单选框"> | ||
<RadioGroup className="horizontal-box" value={defaultValueH} onChange={(value) => setDefaultValueH(value)}> | ||
{Array.from(Array(3), (_, key) => ( | ||
<div className={`card ${defaultValueH === key ? 'card--active' : ''}`} key={key}> | ||
{defaultValueH === key && <Icon name="check" color="#fff" className="card__icon" />} | ||
<Radio borderless value={key} label="单选" icon="none"></Radio> | ||
</div> | ||
))} | ||
</RadioGroup> | ||
</TDemoBlock> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
import React, { useState } from 'react'; | ||
import { Radio, RadioGroup } from 'tdesign-mobile-react'; | ||
|
||
export default function Base() { | ||
const [defaultValue, setDefaultValue] = useState('idx0'); | ||
return ( | ||
<RadioGroup value={defaultValue} className="box" onChange={(value) => setDefaultValue(value)}> | ||
<Radio block={false} label="单选标题" value="idx0"></Radio> | ||
<Radio block={false} label="单选标题" value="idx1"></Radio> | ||
<Radio block={false} label="单选标题" value="idx2"></Radio> | ||
</RadioGroup> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
import React from 'react'; | ||
import { Radio } from 'tdesign-mobile-react'; | ||
|
||
export default function () { | ||
return ( | ||
<> | ||
<Radio label="单选" icon="line" defaultChecked></Radio> | ||
<Radio label="单选" icon="dot" defaultChecked></Radio> | ||
</> | ||
); | ||
} |
Oops, something went wrong.