mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs(DatePicker): fix formatter usage (#10416)
This commit is contained in:
parent
a584cc217b
commit
dd724fde4d
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user