


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:
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
Key processing
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.
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!

The article discusses using Layui's flow module for infinite scrolling, covering setup, best practices, performance optimization, and customization for enhanced user experience.

The article details how to use Layui's element module to create and customize UI elements like tabs, accordions, and progress bars, highlighting HTML structures, initialization, and common pitfalls to avoid.Character count: 159

The article discusses customizing Layui's carousel module, focusing on CSS and JavaScript modifications for appearance and behavior, including transition effects, autoplay settings, and adding custom navigation controls.

The article guides on using Layui's carousel module for image sliders, detailing steps for setup, customization options, implementing autoplay and navigation, and performance optimization strategies.

The article discusses configuring Layui's upload module to restrict file types and sizes using accept, exts, and size properties, and customizing error messages for violations.

The article explains how to use Layui's layer module to create modal windows and dialog boxes, detailing setup, types, customization, and common pitfalls to avoid.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment