From 8f5865dee0b3a7fcc3c3e984aee5f21cd8dee132 Mon Sep 17 00:00:00 2001 From: jin0209 <270246430@qq.com> Date: Mon, 11 Apr 2022 17:03:06 +0800 Subject: [PATCH 1/2] fix(picker): add btn default text --- src/date-time-picker/props.ts | 4 ++-- src/picker/picker.wxml | 6 ++++-- src/picker/props.ts | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/date-time-picker/props.ts b/src/date-time-picker/props.ts index 167eff115..8eaaa9b56 100644 --- a/src/date-time-picker/props.ts +++ b/src/date-time-picker/props.ts @@ -9,12 +9,12 @@ const props: TdDateTimePickerProps = { /** 取消按钮文字 */ cancelBtn: { type: String, - value: '', + value: '取消', }, /** 确定按钮文字 */ confirmBtn: { type: String, - value: '', + value: '确认', }, /** 禁用日期,示例:['A', 'B'] 表示日期 A 和日期 B 会被禁用。{ from: 'A', to: 'B' } 表示在 A 到 B 之间的日期会被禁用。{ before: 'A', after: 'B' } 表示在 A 之前和在 B 之后的日期都会被禁用。其中 A = '2021-01-01',B = '2021-02-01'。值类型为 Function 则表示返回值为 true 的日期会被禁用 */ disableDate: { diff --git a/src/picker/picker.wxml b/src/picker/picker.wxml index a697662f7..38f56f419 100644 --- a/src/picker/picker.wxml +++ b/src/picker/picker.wxml @@ -1,9 +1,11 @@ - {{cancelBtn}} + {{cancelBtn}} {{title}} - {{confirmBtn}} + {{confirmBtn}} diff --git a/src/picker/props.ts b/src/picker/props.ts index bf0be5c01..83b1c7a69 100644 --- a/src/picker/props.ts +++ b/src/picker/props.ts @@ -9,12 +9,12 @@ const props: TdPickerProps = { /** 取消按钮文字 */ cancelBtn: { type: String, - value: '', + value: '取消', }, /** 确定按钮文字 */ confirmBtn: { type: String, - value: '', + value: '确认', }, /** 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容 */ header: { @@ -29,11 +29,11 @@ const props: TdPickerProps = { /** 选中值 */ value: { type: Array, + value: null, }, /** 选中值,非受控属性 */ defaultValue: { - type: null, - value: undefined, + type: Array, }, /** 是否显示 */ visible: { From 468c2895b150e35ac7546422e94ec09cfbdf468c Mon Sep 17 00:00:00 2001 From: jin0209 <270246430@qq.com> Date: Mon, 11 Apr 2022 17:34:08 +0800 Subject: [PATCH 2/2] fix(picker): delete btn default text --- example/pages/picker/picker.wxml | 88 ++++++++++---------------------- src/date-time-picker/props.ts | 4 +- src/picker/props.ts | 4 +- 3 files changed, 32 insertions(+), 64 deletions(-) diff --git a/example/pages/picker/picker.wxml b/example/pages/picker/picker.wxml index 53c32eaf5..07b39454c 100644 --- a/example/pages/picker/picker.wxml +++ b/example/pages/picker/picker.wxml @@ -4,24 +4,20 @@ 城市 - {{selectedCityValue || '选择城市'}} + {{selectedCityValue || '选择城市'}} 年份和季节 - {{selectedYearsWithSeason}} {{selectedSeason}} {{ !selectedYearsWithSeason ? - '选择年份和季节' : ''}} 日期 - {{selectedYearsWithDate}} {{selectedMonth}} {{selectedDay}} {{!selectedYearsWithDate ? - '选择日期' : ''}} @@ -29,29 +25,21 @@ 城市 - {{selectedCityValue2 || '选择城市'}} + {{selectedCityValue2 || '选择城市'}} - + 年份和季节 - {{selectedYearsWithSeason2}} {{selectedSeason2}} {{ !selectedYearsWithSeason2 ? - '选择年份和季节' : ''}} 日期 - {{selectedYearsWithDate2}} {{selectedMonth2}} {{selectedDay2}} {{!selectedYearsWithDate2 ? - '选择日期' : ''}} @@ -61,21 +49,21 @@ - + - + - - + + - + - + - - + + diff --git a/src/date-time-picker/props.ts b/src/date-time-picker/props.ts index 8eaaa9b56..167eff115 100644 --- a/src/date-time-picker/props.ts +++ b/src/date-time-picker/props.ts @@ -9,12 +9,12 @@ const props: TdDateTimePickerProps = { /** 取消按钮文字 */ cancelBtn: { type: String, - value: '取消', + value: '', }, /** 确定按钮文字 */ confirmBtn: { type: String, - value: '确认', + value: '', }, /** 禁用日期,示例:['A', 'B'] 表示日期 A 和日期 B 会被禁用。{ from: 'A', to: 'B' } 表示在 A 到 B 之间的日期会被禁用。{ before: 'A', after: 'B' } 表示在 A 之前和在 B 之后的日期都会被禁用。其中 A = '2021-01-01',B = '2021-02-01'。值类型为 Function 则表示返回值为 true 的日期会被禁用 */ disableDate: { diff --git a/src/picker/props.ts b/src/picker/props.ts index 83b1c7a69..444eb5d46 100644 --- a/src/picker/props.ts +++ b/src/picker/props.ts @@ -9,12 +9,12 @@ const props: TdPickerProps = { /** 取消按钮文字 */ cancelBtn: { type: String, - value: '取消', + value: '', }, /** 确定按钮文字 */ confirmBtn: { type: String, - value: '确认', + value: '', }, /** 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容 */ header: {