1. Select the drop-down box, which needs to be refreshed after default use to display
To use the modules of layui, you need to load the required modules first
layui.use(['form'], function(){
var form = layui.form; //Only after this step is performed, some form elements will be automatically decorated successfully
var $ = layui.$;
//However, if you The HTML is dynamically generated, automatic rendering will fail
//So you need to execute the following method to render manually in the corresponding place, similar to this is element.init();
//This step is the key
form.render();
});
2. Execute a method. When you want to update the data in the form, you need to perform one step update rendering
form.render(); //update allform.render('select'); //Refresh the rendering of the select selection box
3. When using layui's submit to submit and monitor asynchronously, be sure to add return false at the end