1
0
mirror of https://gitee.com/vant-contrib/vant.git synced 2025-04-06 03:57:59 +08:00

fix(DatePicker): only throw error in development ()

This commit is contained in:
neverland 2022-11-13 09:22:48 +08:00 committed by GitHub
parent e6c6265e69
commit 83dcbe6f5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions
packages/vant/src
date-picker
time-picker

@ -128,9 +128,12 @@ export default defineComponent({
case 'day': case 'day':
return genDayOptions(); return genDayOptions();
default: default:
throw new Error( if (process.env.NODE_ENV !== 'production') {
`[Vant] DatePicker: unsupported columns type: ${type}` throw new Error(
); `[Vant] DatePicker: unsupported columns type: ${type}`
);
}
return [];
} }
}) })
); );

@ -83,9 +83,12 @@ export default defineComponent({
filter filter
); );
default: default:
throw new Error( if (process.env.NODE_ENV !== 'production') {
`[Vant] DatePicker: unsupported columns type: ${type}` throw new Error(
); `[Vant] DatePicker: unsupported columns type: ${type}`
);
}
return [];
} }
}) })
); );