el-date-picker清空时间
时间: 2023-08-20 12:08:09 浏览: 117
要清空el-date-picker中选择的时间,可以在timeChange函数中添加代码来实现。根据引用中的指导,可以在value为空时,将this.addform.bizTypeTime赋值为空数组,即可清空时间。具体代码如下:
```javascript
timeChange(value) {
if (value == null) {
this.$refs.saveDateInput.pickerVisible = true;
this.addform.bizTypeTime = [];
};
}
```
这样,在选择清空后,再次点击日期选择器时,时间将被清空。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [关于点击el-date-picker 清空按钮时间选择框不收起的解决方法](https://blog.csdn.net/zhouwei922/article/details/121520858)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [隐藏elemeent-ui中日期选择器的清空按钮,清空图标](https://blog.csdn.net/gxh0816/article/details/122110050)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文