Home > Web Front-end > Layui Tutorial > Why can't my layui progress bar be rendered?

Why can't my layui progress bar be rendered?

王林
Release: 2020-12-11 16:30:01
forward
8420 people have browsed it

Why can't my layui progress bar be rendered?

The solution is as follows:

Tips: You need to consider both static rendering and dynamic rendering of progress bars.

(Related recommendations: layui framework)

 <div class="layui-progress layui-progress-big" lay-filter="demo" lay-showPercent="yes">
        <div class="layui-progress-bar layui-bg-green" lay-percent="50%"></div>
 </div>
Copy after login

The progress bar value cannot be displayed in the above code alone.

(1) Static rendering

The progress bar depends on the element component. If it is not introduced, the progress bar will not be displayed.

layui.use(&#39;element&#39;, function () {
    var element = layui.element;
});
Copy after login

At this time, the progress bar displays the following results:

Why cant my layui progress bar be rendered?

(2) Dynamic rendering

When you need to dynamically change the progress value of the progress bar , layui official website says that the element module provides the basic method of element.progress().

First set the progress bar filter (lay-filter="demo"), and then you only need to execute this method in an event or statement to dynamically change the precision bar value. But for the percentage text displayed in the accuracy bar, users need to change it themselves.

element.progress(&#39;demo&#39;, &#39;80%&#39;);
Copy after login

At this time the progress bar value changes:

Why cant my layui progress bar be rendered?

The above is the detailed content of Why can't my layui progress bar be rendered?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template