docs(DatePicker): fix formatter usage (#10416)

This commit is contained in:
neverland
2022-03-19 19:51:03 +08:00
committed by GitHub
parent a584cc217b
commit dd724fde4d
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -98,14 +98,14 @@ export default {
const currentDate = ref(['2021', '01']); const currentDate = ref(['2021', '01']);
const columnsType = ['year', 'month']; const columnsType = ['year', 'month'];
const formatter = (type, val) => { const formatter = (type, option) => {
if (type === 'year') { if (type === 'year') {
return `${val} Year`; option.text += ' Year';
} }
if (type === 'month') { if (type === 'month') {
return `${val} Month`; option.text += '月Month';
} }
return val; return option;
}; };
return { return {
@@ -102,14 +102,14 @@ export default {
const currentDate = ref(['2021', '01']); const currentDate = ref(['2021', '01']);
const columnsType = ['year', 'month']; const columnsType = ['year', 'month'];
const formatter = (type, val) => { const formatter = (type, option) => {
if (type === 'year') { if (type === 'year') {
return `${val}`; option.text += '年';
} }
if (type === 'month') { if (type === 'month') {
return `${val}`; option.text += '月';
} }
return val; return option;
}; };
return { return {