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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -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 {

View File

@ -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 {