简体   繁体   English

vue2 datepicker清除日期或选择日期无效

[英]vue2 datepicker Clearing the date or choosing a date has no effect

I just downloaded this today and using it in my project. 我今天刚刚下载了这个并在我的项目中使用它。 Everything seems to work where I see it displaying my date from the v-model. 一切似乎都在我看到它从v模型显示我的日期。 However, when choosing a date, it doesn't change the value in the text box. 但是,在选择日期时,它不会更改文本框中的值。

Also, clicking on "x" doesn't clear the value and show placeholder 此外,单击“x”不会清除值并显示占位符

在此输入图像描述

I'm displaying this text inside a client table from vue-tables-2 我在vue-tables-2的客户端表中显示此文本

Here's how I'm using it btw 这是我如何使用它btw

<DatePicker
v-model="props.row.DueDate"
lang="en"
format="MM-DD-YYYY"
:not-before="new Date()"
placeholder="Select a Date"
input-class="form-control"
@change="selectDate"
append-to-body>

Also, I just realized that when clicking on "x" icon it's actually calling the CHANGE event where my function "selectDate" is getting called with an invalid date of course. 此外,我刚刚意识到,当点击“x”图标时,它实际上正在调用CHANGE事件,其中我的函数“selectDate”被调用,当然无效日期。 This doesn't make any sense. 这没有任何意义。 Any idea why this may be happening? 知道为什么会这样吗?

I have created an issue on github for this as well https://github.com/mengxiong10/vue2-datepicker/issues/278 我在github上为此创建了一个问题以及https://github.com/mengxiong10/vue2-datepicker/issues/278

I think the vue datepicker has custom @ functions? 我认为vue datepicker有自定义@函数? try using: @selected, @opened, and @closed let me know if that works! 尝试使用:@ select,@ open和@closed让我知道这是否有效!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM