We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
datetime-picker在部分浏览器不能定位到设置的日期,调试后发现脚本有两处报错如下:
1、~\we-vue\src\components\picker\index.vue 120行
报错:children.find 找不到function
getColumn (columnIndex) { let children = this.children return children.find((child, index) => { return (child.$options.name === 'wv-picker-column' && !child.divider && index === columnIndex) }) }
改为下面的代码不报错:
getColumn (columnIndex) { let children = this.children let columns = children.filter((child, index) => { return (child.$options.name === 'wv-picker-column' && !child.divider && index === columnIndex) }) return columns.length > 0 ? columns[0] : null; }
2、~\we-vue\src\components\picker\picker-column.vue 225行 报错:options.findIndex 找不到function
setValue (value) { const { options } = this const valueIndex = options.findIndex(option => { return this.getOptionText(option) === value }) if (valueIndex > -1) { this.setIndex(valueIndex) } }
setValue (value) { const { options } = this let valueIndex = -1; options.map((option,index)=>{ if(this.getOptionText(option) === value){ valueIndex = index; } }) if (valueIndex > -1) { this.setIndex(valueIndex) } }
解决完两处报错后,可以正常定位到设置的日期。
问题总结:find 和 findIndex没有编译成浏览器都可识别的函数。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
datetime-picker在部分浏览器不能定位到设置的日期,调试后发现脚本有两处报错如下:
1、~\we-vue\src\components\picker\index.vue 120行
报错:children.find 找不到function
改为下面的代码不报错:
2、~\we-vue\src\components\picker\picker-column.vue 225行
报错:options.findIndex 找不到function
改为下面的代码不报错:
解决完两处报错后,可以正常定位到设置的日期。
问题总结:find 和 findIndex没有编译成浏览器都可识别的函数。
The text was updated successfully, but these errors were encountered: