Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common methods of layui

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

This article mainly introduces what are the common methods of layui. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.

Layui (homophonic: class UI) is a front-end UI framework written by its own module specification, which follows the writing and organization form of native HTML/CSS/JS. It has a very low threshold and is ready to use.

Common methods for layui:

The input radio radio box in layui listens for select trigger events:

Find the input according to the lay-filter bound to the input, and then enter the function to determine

Long-term short-term start time: end time: Form.on ('radio (term)' Function (data) {if (data.value = = "short term") {$("# termtime") .removeClass ("layui-hide") } else if (data.value = = "long term") {$("# termtime") .addClass ("layui-hide");}})

Set buttons display different buttons according to status conditions:

{{# if (d.state = = true) {}} offline {{#} else {}} publish {{#}

Various pop-up windows:

Note: because some modules have already declared layer and others do not, the layer pop-up layer is called in the way of layui.layer:

Translucent black background prompt box, automatically closed for 666 milliseconds:

Layui.layer.msg (returndata.msg, {time: 666})

Blue module, pop-up animation on the left, with OK button

Layui.use ('layer', function () {layer.alert (returndata.msg, {skin:' layui-layer-lan', closeBtn: 0, anim: 4 / / Animation Type});})

Input can only enter numbers, not other and decimal points

Tags: Buttons pages frequently used methods data time modules searches events content animation dates formats status short-term articles backgrounds tables roles this is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Apple OPPO Reno vpn Docker