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
由于设置 mode="monthRange" 就没有左右按钮了,所以尝试自己写了一个,代码如下:
mode="monthRange"
const monthRange = ref(['2021-2', '2021-3']) const changeDate = (data, direction) => { let dataArray = [] data.forEach(item => { let year = item.slice(0, item.indexOf('-')) let month = item.slice(item.indexOf('-') + 1) if (direction == 'prev') { month = parseInt(month) - 1 if (month < 1) { month = 12 year = parseInt(year) - 1 } } else { month = parseInt(month) + 1 if (month > 12) { month = 1 year = parseInt(year) + 1 } } dataArray.push(year + '-' + month) }) return dataArray } // 上一个月 const prev = () => { monthRange.value = changeDate(monthRange.value, 'prev') } // 下一个月 const next = () => { monthRange.value = changeDate(monthRange.value, 'next') }
但是 monthRange 无法响应到视图,请问如何能做到响应呢? 以尝试用 nextTick 但无效,还望指点!谢谢
monthRange
nextTick
The text was updated successfully, but these errors were encountered:
No branches or pull requests
由于设置
mode="monthRange"
就没有左右按钮了,所以尝试自己写了一个,代码如下:但是
monthRange
无法响应到视图,请问如何能做到响应呢?以尝试用
nextTick
但无效,还望指点!谢谢The text was updated successfully, but these errors were encountered: