-
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接口,补充对应文档和适配样式 (#468)
* feat(radio): 重构radio dom接口,补充对应文档和适配样式 fix #461 * fix(radio): readonly & allowUncheck 支持 fix #461 * chore: update snapshot * chore: update snapshot * chore: update _common --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: anlyyao <[email protected]>
- Loading branch information
1 parent
de1c433
commit 4b92263
Showing
27 changed files
with
2,281 additions
and
330 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
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.
Oops, something went wrong.