When using layui beautification, retain the change event in the select

Release: 2019-11-25 15:28:53
forward
3126 people have browsed it

When using layui beautification, retain the change event in the select

Many friends have encountered the problem that the change event inside is not triggered after beautification. The previous suggestion was to make full use of layui components since they are used. It also provides corresponding Select event of the form, but if these nodes existed before and later used layui, wouldn't it be necessary to move the corresponding events over?

Recommended: layui usage tutorial

Is there any way to beautify and retain events? The answer is yes, and there are many possible ways. , here is a modification method that I think is the simplest and most convenient for reference.

Rendering:

When using layui beautification, retain the change event in the select

You may not be able to see anything from the picture, but look at the key code. The pop-up information in the picture is actually bound to select The event pops up

When using layui beautification, retain the change event in the selectWhen using layui beautification, retain the change event in the select

Key processing

When using layui beautification, retain the change event in the select

Test code: https://pan. baidu.com/s/1aZj6MnfL5w4FNFryprPqxw

Then if any friends find that after the change, the node selection without adding lay-filter will trigger the original binding event twice. Please also move to what I just mentioned. There is an introduction in the post I came across. This should be a bug in layui itself. My latest modifications are as follows.

When using layui beautification, retain the change event in the select

The two commented lines are the original code. Replace it with the following line. Will the modification have any adverse effects? You can rest assured that this will not have any adverse effects.

The above is the detailed content of When using layui beautification, retain the change event in the select. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:layui.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template