mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Picker 样式优化
This commit is contained in:
parent
9bd8fc4a2d
commit
30c8f641f2
@ -22,6 +22,7 @@ export default {
|
||||
name: "type",
|
||||
label: "单选",
|
||||
value: 1,
|
||||
inline: true,
|
||||
options: [
|
||||
{
|
||||
label: "选项1",
|
||||
|
@ -12,6 +12,7 @@ fis.get('project.ignore').push(
|
||||
// 配置只编译哪些文件。
|
||||
|
||||
fis.set('project.files', [
|
||||
'scss/**.scss',
|
||||
'/examples/*.html',
|
||||
'/src/**.html',
|
||||
'mock/**'
|
||||
|
@ -105,6 +105,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
.#{$ns}PickerControl {
|
||||
padding-top: $Form-input-height - px2rem(30px);
|
||||
.#{$ns}PickerControl.is-inline {
|
||||
.#{$ns}Picker {
|
||||
display: inline-block;
|
||||
min-width: px2rem(150px);
|
||||
}
|
||||
}
|
||||
|
@ -41,11 +41,13 @@ export default class PickerControl extends React.PureComponent<PickerProps, any>
|
||||
"inline",
|
||||
"multiple",
|
||||
"embed",
|
||||
"resetValue"
|
||||
"resetValue",
|
||||
"placeholder"
|
||||
];
|
||||
static defaultProps: Partial<PickerProps> = {
|
||||
modalMode: 'dialog',
|
||||
multiple: false,
|
||||
placeholder: "请点击按钮选择",
|
||||
pickerSchema: {
|
||||
mode: 'list',
|
||||
listItem: {
|
||||
@ -273,9 +275,10 @@ export default class PickerControl extends React.PureComponent<PickerProps, any>
|
||||
env,
|
||||
clearable,
|
||||
multiple,
|
||||
inline,
|
||||
placeholder,
|
||||
embed,
|
||||
value
|
||||
value,
|
||||
selectedOptions
|
||||
} = this.props;
|
||||
return (
|
||||
<div className={cx(`PickerControl`, className)}>
|
||||
@ -286,7 +289,6 @@ export default class PickerControl extends React.PureComponent<PickerProps, any>
|
||||
) : (
|
||||
<div
|
||||
className={cx(`Picker`, {
|
||||
'Picker--inline': inline,
|
||||
'Picker--single': !multiple,
|
||||
'Picker--multi': multiple,
|
||||
'is-focused': this.state.isFocused,
|
||||
@ -294,6 +296,10 @@ export default class PickerControl extends React.PureComponent<PickerProps, any>
|
||||
})}
|
||||
>
|
||||
<div onClick={this.handleClick} className={cx('Picker-input')}>
|
||||
{!selectedOptions.length && placeholder ? (
|
||||
<div className={cx('Picker-placeholder')}>{placeholder}</div>
|
||||
) : null}
|
||||
|
||||
<div className={cx('Picker-valueWrap')}>
|
||||
{this.renderValues()}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user