This tutorial teaches you how to make a "walking" bootstrap progress bar for your reference. The specific content is as follows
1. Page effect:
Starting position:
After clicking the "Go" button
2 .html code:
<div> <div class="progress progress-striped active"> <div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" v-bind:style="progressStyle">进度条</div> </div> <button type='button' v-on:click='queryEnterprise' class='btn btn-primary'>走</button> </div>
v-bind:style="progressStyle"
Bind inline style:
a. Object syntax: The object syntax of v-bind:style is very intuitive - it looks very like CSS, Actually it is a JavaScript object. CSS property names can be named in camelCase or kebab-case:
eg:
html:
<div v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }"></div>
js:
data: { activeColor: 'red', fontSize: 30 }
directly bound to a Style objects are usually better and make the template clearer:
html:
<div v-bind:style="styleObject"></div>
js:
data: { styleObject: { color: 'red', fontSize: '13px' } }
b. Array syntax: The array syntax of v-bind:style can combine multiple style objects Applied to an element:
eg:
html:
<div v-bind:style="[styleObjectA, styleObjectB]">
data: { styleObjectA: { color: 'red' }, styleObjectB:{ fontSize: '13px' } }
c. Automatically add prefix: When v-bind:style uses CSS properties that require vendor prefixes, such as transform, Vue.js will automatically Detect and add the appropriate prefix.
3.js code:
<script> export default { components:{}, props:{}, ready:function(){}, computed:{}, methods:{ queryEnterprise:function(){ if(parseInt(this.progressStyle.width)<100){ this.progressStyle.width=parseInt(this.progressStyle.width)+30+'%'; }else{ alert("进度条已经走完"); } } }, data () { return { //进度条样式 progressStyle:{ width:'10%', }, } }, } </script>
4.style
.progress { height: 40px; transition: 3s; } .progress-bar { font-size: 16px; line-height: 40px; }
The above is the entire content of this article, I hope it will be helpful to everyone’s study

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1
Easy-to-use and free code editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
