
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pro-progress-bar
Advanced tools



npm install pro-progress-bar
全局注册
import ProgressBar from 'pro-progress-bar'
// 进度条配置项
const progressOptions = {
succColor: '#f12b25',
failColor: '#E5433E',
gradient: false, // 线性渐变
gradientColor: {
successColor: 'linear-gradient(0deg, #FF6B48 0%, #FF9946 54%, #FFB944 100%)',
failColor: 'linear-gradient(0deg, #A5A5A5 0%, #C0C0C0 54%, #D8D8D8 100%)'
},
stripe: true, // 开启条纹进度条
stripeColor: {
successColor: 'repeating-linear-gradient(-45deg, #ff8b46 25%, #ff6c2a 0, #ff6c2a 50%, #ff6c2a 0, #ff8b46 75%, #ff6c2a 0)',
failColor: 'repeating-linear-gradient(-45deg, #c8c8c8 25%, #b2b2b2 0, #b2b2b2 50%, #b2b2b2 0, #c8c8c8 75%, #b2b2b2 0)'
},
transition: {
widthSpeed: 200,
opacitySpeed: 400,
duration: 800 // 定义消失时间 ms
},
inverse: true, // 进度条的加载方向
thickness: 18, // 进度条的高度
autoFinish: false // 设定动画是否可以自动完成,默认是 true
}
Vue.use(ProgressBar,progressOptions)
局部注册
<script>
import ProgressBar from 'pro-progress-bar'
export default {
name:'xxx',
components:{ProgressBar}
}
</script>
在项目中使用
<template>
<div class="home">
<button class="md-btn md-theme-primary" type="button" @click="openProgress()">导出成功</button>
<button class="md-btn md-theme-error" type="button" @click="openProgressFail()">导出失败</button>
</div>
</template>
<script>
export default {
name: 'HomeView',
components: {
},
methods:{
openProgress(){
this.$progress.start({tip:'正在导出中...,请稍后'})
setTimeout(()=>{
//模拟ajax请求
this.$progress.finish('导出成功')
},1000)
},
openProgressFail(){
this.$progress.start({tip:'正在导出中...,请稍后'})
setTimeout(()=>{
//模拟ajax请求
this.$progress.fail('导出失败')
},1000)
}
}
}
</script>
<style>
.md-btn{
font-size:18px;
line-height:40px;
border:none;
outline:none;
color:#fff;
margin-right:20px;
border-radius:4px;
cursor:pointer;
}
.md-theme-primary{
background:blue;
}
.md-theme-error{
background:red;
}
</style>
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| tip | 进度条start的提示信息文字 | String | 导出中 |
| time | 用来控制进度条加载的快慢,数值越大,加载时长越长,加载越慢 | Number | 100 |
FAQs
--- typora-root-url: public ---
We found that pro-progress-bar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.