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
Bug Type: Component
Component
3.4.15
2.7.1
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Vite
el-date-picker
el-time-picker
Element Plus Playground
修改 el-input 的 clearable 默认属性后,不应该影响到其他组件。
修改 el-input 的 clearable 默认属性后,影响到el-date-picker和 el-time-picker。
查看源码后,el-date-picker 和 el-time-picker组件都有用到picker.vue组件(“element-plus/packages/components/time-picker/src/common /picker.vue”),其中使用到的 el-input 组件并没有显式传入 :clearable ="false" 属性
The text was updated successfully, but these errors were encountered:
本质是 input 的默认 Props 被更改了(Object.assign(ElInput.props.clearable, { default: true })),对象引用,更改了这个值,其他地方新建的 el-input 也会生效。建议优先配置 :clearable="false"
Object.assign(ElInput.props.clearable, { default: true })
:clearable="false"
Sorry, something went wrong.
嗯,对的,直接在picker.vue这个组件文件中显式配置 :clearable="false"是最便捷的解决方案
Successfully merging a pull request may close this issue.
Bug Type:
Component
Environment
3.4.15
2.7.1
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Vite
Reproduction
Related Component
el-date-picker
el-time-picker
Reproduction Link
Element Plus Playground
Steps to reproduce
<script setup lang="ts"> import { ref } from 'vue' import { ElInput } from 'element-plus' Object.assign(ElInput.props.clearable, { default: true }) const msg = ref('Hello World!') const date = ref() const time = ref() </script>What is Expected?
修改 el-input 的 clearable 默认属性后,不应该影响到其他组件。
What is actually happening?
修改 el-input 的 clearable 默认属性后,影响到el-date-picker和 el-time-picker。
Additional comments
查看源码后,el-date-picker 和 el-time-picker组件都有用到picker.vue组件(“element-plus/packages/components/time-picker/src/common
/picker.vue”),其中使用到的 el-input 组件并没有显式传入 :clearable ="false" 属性
The text was updated successfully, but these errors were encountered: