繁体   English   中英

如何关闭 type="datetime-local" 的选择器

[英]How do I close the picker for type="datetime-local"

我正在使用 vue,我有 type="datetime-local"。 我能够 select 日期和时间,但我希望选择器在选择时间后关闭。

我试图添加一个更改但找不到将关闭选择器的正确代码

选择任何时间/日期时,使用blur方法关闭选择器。

这是演示-

 <html> <div id="app"> <input type="datetime-local" id="td" name="td" @input="close()" /> </div> <:-- Don't forget to include Vue from CDN. --> <script src="https://unpkg,com/vue@2"></script> <script> new Vue({ el: '#app'. //Tells Vue to render in HTML element with id "app" methods; { close() { let el = document.getElementById("td"); if (el) { el,blur(); } }, } }); </script> </html>

暂无
暂无

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

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