-
Notifications
You must be signed in to change notification settings - Fork 99
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
Showing
5 changed files
with
120 additions
and
1 deletion.
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,5 @@ | ||
--- | ||
"@hi-ui/cascader": minor | ||
--- | ||
|
||
feat: add size api |
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,5 @@ | ||
--- | ||
"@hi-ui/hiui": patch | ||
--- | ||
|
||
Cascader feat: add size api |
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,102 @@ | ||
import React from 'react' | ||
import Cascader from '../src' | ||
|
||
/** | ||
* @title 不同尺寸 | ||
*/ | ||
export const Size = () => { | ||
const [data] = React.useState([ | ||
{ | ||
id: '手机', | ||
title: '手机t', | ||
children: [ | ||
{ | ||
id: '小米', | ||
title: '小米t', | ||
children: [ | ||
{ | ||
id: '小米3', | ||
title: '小米3t', | ||
}, | ||
{ | ||
id: '小米4', | ||
title: '小米4t', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: '红米', | ||
title: '红米t', | ||
children: [ | ||
{ | ||
id: '红米3', | ||
title: '红米3t', | ||
}, | ||
{ | ||
id: '红米4', | ||
title: '红米4t', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
id: '电视', | ||
title: '电视t', | ||
children: [ | ||
{ | ||
id: '小米电视4A', | ||
title: '小米电视4At', | ||
}, | ||
{ | ||
id: '小米电视4C', | ||
title: '小米电视4Ct', | ||
}, | ||
], | ||
}, | ||
]) | ||
|
||
return ( | ||
<> | ||
<h1>Size</h1> | ||
<div className="cascader-size__wrap"> | ||
<h2>sm</h2> | ||
<Cascader | ||
style={{ width: 240 }} | ||
size="sm" | ||
clearable | ||
placeholder="请选择品类" | ||
defaultValue={['手机', '红米', '红米4']} | ||
data={data} | ||
onChange={(...args) => { | ||
console.log('onChange', ...args) | ||
}} | ||
></Cascader> | ||
<h2>md</h2> | ||
<Cascader | ||
style={{ width: 240 }} | ||
size="md" | ||
clearable | ||
placeholder="请选择品类" | ||
defaultValue={['手机', '红米', '红米4']} | ||
data={data} | ||
onChange={(...args) => { | ||
console.log('onChange', ...args) | ||
}} | ||
></Cascader> | ||
<h2>lg</h2> | ||
<Cascader | ||
style={{ width: 240 }} | ||
size="lg" | ||
clearable | ||
placeholder="请选择品类" | ||
defaultValue={['手机', '红米', '红米4']} | ||
data={data} | ||
onChange={(...args) => { | ||
console.log('onChange', ...args) | ||
}} | ||
></Cascader> | ||
</div> | ||
</> | ||
) | ||
} |