Element: [Bug Report] DateTimePicker设置clearable为false,但是日期选择里面“清空”按钮并没有隐藏

Created on 16 May 2019  ·  10Comments  ·  Source: ElemeFE/element

Element UI version

2.8.2

OS/Browsers version

macOS Mojave / Chrome 74.0.3729.157

Vue version

2.6.10

Reproduction Link

https://jsfiddle.net/10h37bs5/

Steps to reproduce

点击输入框选择日期

What is Expected?

预期没有清空按钮

What is actually happening?

清空按钮仍然显示

stale

All 10 comments

https://codepen.io/masongzhi123/pen/gJWKXG?&editable=true
jsfiddle 我打开不了,是否传了字符串的 false 属性,上面demo是正常的

https://codepen.io/masongzhi123/pen/gJWKXG?&editable=true
jsfiddle 我打开不了,是否传了字符串的 false 属性,上面demo是正常的

好像把type改为 datetimerange就有问题了

https://codepen.io/masongzhi123/pen/mYmKjB
也没问题,你对比下

https://codepen.io/masongzhi123/pen/mYmKjB
也没问题,你对比下

下面的下拉出来那里还有清空,输入框里的消失了是没问题的

清空和确认这两个按钮是不受 clearable 影响的

<div class="el-picker-panel__footer" v-if="showTime">
    <el-button
        size="mini"
        type="text"
        class="el-picker-panel__link-btn"
        @click="handleClear">
        {{ t('el.datepicker.clear') }}
    </el-button>
    <el-button
        plain
        size="mini"
        class="el-picker-panel__link-btn"
        :disabled="btnDisabled"
        @click="handleConfirm(false)">
        {{ t('el.datepicker.confirm') }}
    </el-button>
</div>

输入框里的叉叉确实没有了,但是下面的清空按钮还在,所以看源码就知道肯定是有问题的了。

既然clearable的用意是不允许删除,下面的清空按钮也应该隐藏掉。

Are your English is bad?

我也认为既然 clearable 为 false 那么, 底下不应该显示"清空"

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings