vue中进度条写法_vue组件实现进度条效果
這篇文章主要為大家詳細介紹了vue組件實現進度條效果,具有一定的參考價值,可以用來參考一下。
感興趣的小伙伴,下面一起跟隨512筆記的小編兩巴掌來看看吧!
本文實例為大家分享了vue實現進度條效果的具體代碼,供大家參考,具體內容如下
一、效果圖
【圖片暫缺】
二、代碼
progress-bar.vue
代碼如下:
export default {
props:{
label:String,
text:String,
height:{
type: Number,
default: 0,
required: true,
validator: val => val >= 0
},
color: {
type: String,
default: ''
},
percentage:{
type: Number,
default: 0,
required: true,
validator: val => val >= 0 && val <= 100
}
},
computed:{
barStyle() {
const style = {};
style.width = this.percentage + '%';
style.height = this.height + 'px';
style.backgroundColor = this.color;
return style;
}
}
}
.vue-progress-bar.default-theme{
.vue-progress-bar__outer {
background: #eee;
}
}
.vue-progress-bar {
.vue-progress-bar__tiptext {
float: right;
}
}
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持512筆記。
注:關于vue組件實現進度條效果的內容就先介紹到這里,更多相關文章的可以留意512筆記的其他信息。
關鍵詞:vue.js
總結
以上是生活随笔為你收集整理的vue中进度条写法_vue组件实现进度条效果的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python文件存储过程_python调
- 下一篇: corspost请求失败_vue项目CO