Skip to content

Commit

Permalink
Merge pull request #435 from Tencent/fix/picker/title-align
Browse files Browse the repository at this point in the history
Fix/picker/title align
  • Loading branch information
JJunYang authored May 9, 2022
2 parents 164f23f + f81d7cf commit 5b47bcc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
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

0 comments on commit 5b47bcc

Please sign in to comment.