The progress bar of layui is not displayed dynamically when loading

The progress bar of layui is not displayed dynamically when loading

Stepping on the pit: the dynamic loading of layui's progress bar is not displayed.
insert image description here
You can see that the official example is a dynamic loading of a percentage ratio.
Students who are not very clear go to the official website of layui to see his examples and a progress bar document layui.com .
But xdm found that the progress bar in percentage format can be used, but that kind of fractional form, there is no way to use his format to go

Solution:

One: Necessary conditions for dynamic acquisition: element module

insert image description here
We need to introduce this element module to dynamically operate the progress bar
insert image description here
. After introducing the element module, call its progress method.
This method has two parameters. The first parameter is: the progress bar with the filter (lay-filter="") set, The first parameter is this;
the second parameter is the parameter corresponding to where you want it to be dynamic.
insert image description here
After setting, you need to initialize and load the element again,
just add this sentence:
In this way, you can set the dynamic fraction form The dynamic progress bar
insert image description here

Overall example code

progress bar code insert image description here
layui control code
insert image description here

insert image description here

Guess you like

Origin blog.csdn.net/qq_45844443/article/details/117951850