-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
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
[Component] [date-picker] 动态修改disabled-date不生效 #12633
Labels
Comments
liliting
changed the title
[Component] [date-picker] [Component][el-date-picker]动态修改disabled-date不生效
[Component] [date-picker] 动态修改disabled-date不生效
Apr 27, 2023
我提交了一段代码可以解决这个问题,但是我另一次PR还没有审核通过我不知道怎么再次提交PR |
rebase一份新代码 之后 把hade指向初始化的commitid 自己fork的项目 新开一个分支 就行了 |
所以这个什么时候能被合并呢🥲 |
<el-date-picker v-model="time" type="date" placeholder="起始时间" class="origin" @change="changeEnd">
<template #default="cell">
<div class="cell" :class="{ disabled: cell.dayjs.format('YYYY-MM-DD') < maxt }" @click="(e: Event) => {
if (cell.dayjs.format('YYYY-MM-DD') < max) e.stopPropagation();
}">
<span class="text">{{ cell.text }}</span>
</div>
</template>
</el-date-picker>
<style scoped>
.cell.disabled .text {
color: var(--el-datepicker-off-text-color);
cursor: auto;
}
</style> @wrrc 暂时这样绕过了,自定义 |
@alonelucky 我最后改的是:函数固定,增加 开始时间 和 结束时间 <el-date-picker
:disabled-date="disabledDate"
/> function disabledDate (time: Date) {
if (props.disabledDateStart || props.disabledDateEnd) {
// undefined 也没关系,会返回 false 的
return (
time < props.disabledDateStart! ||
time > props.disabledDateEnd!
)
}
return false
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Type:
Component
Environment
3.2.39
2.2.32
Chrome 112.0.5615.137(正式版本) (x86_64)
Vite
Reproduction
Related Component
el-date-picker
Reproduction Link
Element Plus Playground
Steps to reproduce
1、页面加载出来后disabled-date是初始设置的时间,
2、点击【修改不可用日期】后,数据表更,但时间选择器的不可用日期未更新
What is Expected?
期望不可用日期跟随设置变动
What is actually happening?
不可用日期未更新
Additional comments
(empty)
The text was updated successfully, but these errors were encountered: