-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug Report]datePicker组件不能正常使用 #389
Comments
I found a similar closed issue: [Bug Report] View UI Plus DatePicker 日期选择器 不显示,并浏览器报错. This issue was referenced by: [Bug Report]datePicker组件不能正常使用, which was last updated on September 19, 2024. To resolve the TypeError "Cannot read properties of null (reading 'slice')" in the datePicker component, ensure that the In the data () {
const isRange = this.type.includes('range');
const emptyArray = isRange ? [null, null] : [null];
const initialValue = isEmptyArray((isRange ? this.modelValue : [this.modelValue]) || []) ? emptyArray : this.parseDate(this.modelValue);
const focusedTime = initialValue.map(extractTime);
return {
prefixCls: prefixCls,
showClose: false,
visible: false,
internalValue: initialValue,
disableClickOutSide: false,
disableCloseUnderTransfer: false,
selectionMode: this.onSelectionModeChange(this.type),
forceInputRerender: 1,
isFocused: false,
focusedDate: initialValue[0] || this.startDate || new Date(),
focusedTime: {
column: 0,
picker: 0,
time: focusedTime,
active: false
},
internalFocus: false,
isValueNull: false,
timeSpinnerList: [],
panelTableList: []
};
} Additionally, ensure that computed: {
publicVModelValue(){
if (this.multiple){
return Array.isArray(this.internalValue) ? this.internalValue.slice() : [];
} else {
const isRange = this.type.includes('range');
let val = this.internalValue.map(date => date instanceof Date ? new Date(date) : (date || ''));
if (this.type.match(/^time/)) val = val.map(this.formatDate);
return (isRange || this.multiple) ? val : val[0];
}
}
} By ensuring |
i had these error, when i used viewUiPlus in Nuxt3 with i18n Module. When i removed i18n module from Nuxt, error was disapepared. |
Environment
谷歌浏览器允许的vue3项目
Reproduction link
https://www.iviewui.com/view-ui-plus/component/form/date-picker
Steps to reproduce
viewuiplus.min.js:44 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'slice')
What is expected?
能尽快解决
What is actually happening?
尽快解决bug,回出详细解决方案
The text was updated successfully, but these errors were encountered: