Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/picker/title align #435

Merged
merged 2 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/picker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ Page({

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
cancel-btn | String | 取消 | 取消按钮文字 | N
confirm-btn | String | 确认 | 确定按钮文字 | N
cancel-btn | String | '' | 取消按钮文字 | N
confirm-btn | String | '' | 确定按钮文字 | N
footer | Slot | - | 底部内容 | N
header | Boolean / Slot | true | 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容 | N
title | String | '' | 标题 | N
Expand All @@ -72,9 +72,9 @@ visible | Boolean | false | 是否显示 | N

名称 | 参数 | 描述
-- | -- | --
cancel | `({})` | 点击取消按钮时触发
cancel | - | 点击取消按钮时触发
change | `(value: Array<PickerValue>)` | 选中变化时候触发
confirm | `({})` | 点击确认确认按钮时触发
confirm | `(index: number, value: Array<PickerValue>)` | 点击确认确认按钮时触发

### PickerItem Props

Expand Down
5 changes: 5 additions & 0 deletions src/picker/picker.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
}

&__title {
flex: 1;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: @text-level-1-color;
font-weight: @picker-font-weight;
}
Expand Down
4 changes: 1 addition & 3 deletions src/picker/picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ export default class Picker extends SuperComponent {
return { index: undefined, value: undefined };
}

const selectedValues = {
return {
index: pickerColumns.map((pickerColumn) => pickerColumn._selectedIndex),
value: pickerColumns.map((pickerColumn) => pickerColumn._selectedValue),
};

return selectedValues;
},
onConfirm() {
this.triggerEvent('confirm', this.getSelectedValues());
Expand Down