300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > vue中进度条写法_vue组件实现进度条效果

vue中进度条写法_vue组件实现进度条效果

时间:2024-05-21 18:17:02

相关推荐

vue中进度条写法_vue组件实现进度条效果

这篇文章主要为大家详细介绍了vue组件实现进度条效果,具有一定的参考价值,可以用来参考一下。

感兴趣的小伙伴,下面一起跟随512笔记的小编两巴掌来看看吧!

本文实例为大家分享了vue实现进度条效果的具体代码,供大家参考,具体内容如下

一、效果图

【图片暂缺】

二、代码

progress-bar.vue

代码如下:

{{label}}

{{text}}

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

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。