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内置无数据中文提示文案问题 #1134

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 2 additions & 1 deletion compiled/alipay/demo/pages/Picker/index.axml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
placeholder="请选择"
title="请选择"
onChange="handleChange"
options="{{ list }}" />
options="{{ list }}"
emptyText="暂无数据" />
</ant-list-item>
<ant-list-item>
选择城市(点击蒙层不关闭)
Expand Down
2 changes: 1 addition & 1 deletion compiled/alipay/src/Picker/index.axml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<picker-view>
<picker-view-column>
<!-- display: inline -->
<text style="color: #ccc">暂无数据</text>
<text style="color: #ccc">{{ emptyText }}</text>
</picker-view-column>
</picker-view>
</block>
Expand Down
1 change: 1 addition & 0 deletions compiled/alipay/src/Picker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Picker 选择器显示一个或多个选项集合的可滚动列表,相比于
| maskClosable | 点击蒙层是否可以关闭 | boolean |true | |
| maskStyle | 蒙层的样式 | string | - |
| okText | 确认按钮文案 | string | '确定' |
| emptyText | 无数据时提示文案 | string | '暂无数据' |
| options | picker 数据,配置每一列的选项 | [PickerColumnItem](#pickercolumnitem)[] | [] |
| placeholder | 提示文案 | string | '请选择' |
| popClassName | 弹出框类名 | string | - |
Expand Down
6 changes: 6 additions & 0 deletions compiled/alipay/src/Picker/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export interface IPickerProps extends IBaseProps {
* @default '请选择'
*/
placeholder: string;
/**
* @description 无数据时提示文案
* @default '暂无数据'
*/
emptyText?: string;
/**
* @description picker 数据
*/
Expand Down Expand Up @@ -133,6 +138,7 @@ export const PickerDefaultProps: Partial<IPickerProps> = {
options: [],
placeholder: '请选择',
defaultValue: [],
emptyText: '暂无数据'
};

export const PickerFunctionalProps: Partial<IPickerProps> = {
Expand Down
3 changes: 2 additions & 1 deletion compiled/wechat/demo/pages/Picker/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
placeholder="请选择"
title="请选择"
bind:change="handleChange"
options="{{ list }}" />
options="{{ list }}"
emptyText="暂无数据" />
</ant-list-item>
<ant-list-item>
选择城市(点击蒙层不关闭)
Expand Down
1 change: 1 addition & 0 deletions compiled/wechat/src/Picker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Picker 选择器显示一个或多个选项集合的可滚动列表,相比于
| maskClosable | 点击蒙层是否可以关闭 | boolean |true | |
| maskStyle | 蒙层的样式 | string | - |
| okText | 确认按钮文案 | string | '确定' |
| emptyText | 无数据时提示文案 | string | '暂无数据' |
| options | picker 数据,配置每一列的选项 | [PickerColumnItem](#pickercolumnitem)[] | [] |
| placeholder | 提示文案 | string | '请选择' |
| popClassName | 弹出框类名 | string | - |
Expand Down
2 changes: 1 addition & 1 deletion compiled/wechat/src/Picker/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<picker-view>
<picker-view-column>
<!-- display: inline -->
<text style="color: #ccc">暂无数据</text>
<text style="color: #ccc">{{ emptyText }}</text>
</picker-view-column>
</picker-view>
</block>
Expand Down
1 change: 1 addition & 0 deletions compiled/wechat/src/Picker/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export var PickerDefaultProps = {
options: [],
placeholder: '请选择',
defaultValue: [],
emptyText: '暂无数据'
};
export var PickerFunctionalProps = {
formattedValueText: null,
Expand Down
1 change: 1 addition & 0 deletions demo/pages/Picker/index.axml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default ({
title="请选择"
onChange="handleChange"
options={list}
emptyText="暂无数据"
></AntPicker>
</AntListItem>
<AntListItem>
Expand Down
3 changes: 2 additions & 1 deletion src/Picker/index.axml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default (
indicatorStyle,
indicatorClassName,
options,
emptyText
}: TSXMLProps<IPickerProps>,
{ state, formatValue, selectedIndex, columns }: InternalData
) => (
Expand Down Expand Up @@ -127,7 +128,7 @@ export default (
<Block>
<PickerView>
<PickerViewColumn>
<Text style="color: #ccc">暂无数据</Text>
<Text style="color: #ccc">{emptyText}</Text>
</PickerViewColumn>
</PickerView>
</Block>
Expand Down
1 change: 1 addition & 0 deletions src/Picker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Picker 选择器显示一个或多个选项集合的可滚动列表,相比于
| maskClosable | 点击蒙层是否可以关闭 | boolean |true | |
| maskStyle | 蒙层的样式 | string | - |
| okText | 确认按钮文案 | string | '确定' |
| emptyText | 无数据时提示文案 | string | '暂无数据' |
| options | picker 数据,配置每一列的选项 | [PickerColumnItem](#pickercolumnitem)[] | [] |
| placeholder | 提示文案 | string | '请选择' |
| popClassName | 弹出框类名 | string | - |
Expand Down
6 changes: 6 additions & 0 deletions src/Picker/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export interface IPickerProps extends IBaseProps {
* @default '请选择'
*/
placeholder: string;
/**
* @description 无数据时提示文案
* @default '暂无数据'
*/
emptyText?: string;
/**
* @description picker 数据
*/
Expand Down Expand Up @@ -133,6 +138,7 @@ export const PickerDefaultProps: Partial<IPickerProps> = {
options: [],
placeholder: '请选择',
defaultValue: [],
emptyText: '暂无数据'
};

export const PickerFunctionalProps: Partial<IPickerProps> = {
Expand Down
Loading