mirror of
https://github.com/youzan/vant.git
synced 2026-05-16 01:07:43 +08:00
docs(DatePicker): fix formatter usage (#10416)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user