Home>Article>Web Front-end> Introduction to the use of layui framework form forms

Introduction to the use of layui framework form forms

尚
forward
2019-12-18 17:09:22 4207browse

Introduction to the use of layui framework form forms

Although I am familiar with layui, I have time today to take another look at the form module of layui.

1. Update rendering

layui does not have a two-way binding mechanism, but with a classic modular framework, you only need to execute the following method:

form.render(type, filter)

The first parameter: type

form.render(); //更新全部 form.render('select'); //刷新select选择框渲染 [select,checkbox,radio] //刷新[select选择框,checkbox复选框(含开关)][radio]渲染

The second parameter: filter [can be used for local updates] is the lay-filter of the element where class="layui-form" is located ="" value. You can use this parameter to complete partial updates to the form.