Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem of layui time control flicker

Shulou Source: shulou.com Published: 2022-06-03 10:59:24 10月04日 Update

Editor to share with you how to solve the problem of layui time control flicker, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Project online, found that the background management system layui sub-page time control flicker problem, simply can not select the time.

The reason is that if multiple nodes are found on a page, only the first node can be used normally and the subsequent nodes will flicker. It can be understood that laydate does not support render multiple nodes at a time. It's not a matter of instance repetition, because the instance I create on each page is different or flashback. In the background management system, this kind of parent-child page does have multiple pages using time controls, thus render multiple nodes.

Solution:

The default configuration in the laydate file, trigger: 'focus' / / the focus for outbound control events is changed to click.

The test deployment is valid online.

Layui.use ('laydate', function () {var laydate = layui.laydate; / / date and time selector laydate.render ({elem:' # startTime', type: 'datetime', trigger:' click'// outbound event is changed to click / /, format: 'yyyy-MM-dd HH:mm:ss' / / can be arbitrarily combined}) / / date and time selector laydate.render ({elem:'# endTime', type: 'datetime', trigger:' click'// outbound event changed to click / /, format: 'yyyy-MM-dd HH:mm:ss' / / can be arbitrarily combined});}) The above is all the contents of the article "how to solve the problem of layui time control flicker". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Time controls nodes pages questions multiple events articles content background instance date Management system system Management composition selection effective one-time not much Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft MariaDB Redmi Xiaomi Shulou Information