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

This commit is contained in:
neverland
2022-11-13 09:22:48 +08:00
committed by GitHub
parent e6c6265e69
commit 83dcbe6f5f
2 changed files with 12 additions and 6 deletions

View File

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

View File

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