From dd724fde4d43dd9570468337463dc883cbe94d2a Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 19 Mar 2022 19:51:03 +0800 Subject: [PATCH] docs(DatePicker): fix formatter usage (#10416) --- packages/vant/src/date-picker/README.md | 8 ++++---- packages/vant/src/date-picker/README.zh-CN.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/vant/src/date-picker/README.md b/packages/vant/src/date-picker/README.md index df22493ae..469a43238 100644 --- a/packages/vant/src/date-picker/README.md +++ b/packages/vant/src/date-picker/README.md @@ -98,14 +98,14 @@ export default { const currentDate = ref(['2021', '01']); const columnsType = ['year', 'month']; - const formatter = (type, val) => { + const formatter = (type, option) => { if (type === 'year') { - return `${val} Year`; + option.text += ' Year'; } if (type === 'month') { - return `${val} Month`; + option.text += '月Month'; } - return val; + return option; }; return { diff --git a/packages/vant/src/date-picker/README.zh-CN.md b/packages/vant/src/date-picker/README.zh-CN.md index ba1b792e4..6d338ba15 100644 --- a/packages/vant/src/date-picker/README.zh-CN.md +++ b/packages/vant/src/date-picker/README.zh-CN.md @@ -102,14 +102,14 @@ export default { const currentDate = ref(['2021', '01']); const columnsType = ['year', 'month']; - const formatter = (type, val) => { + const formatter = (type, option) => { if (type === 'year') { - return `${val}年`; + option.text += '年'; } if (type === 'month') { - return `${val}月`; + option.text += '月'; } - return val; + return option; }; return {