rightbl.vue
846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<template>
<div class="rightbl">
<div class="slider-bg">
<div :style="'width:'+wid*200+'px;'" class="slider-color" />
</div>
<div class="bl">{{ data }}</div>
</div>
</template>
<script>
export default {
name: 'Rightbl',
props: {
data: {
type: String,
default: ''
}
},
computed: {
wid() {
return parseFloat(this.data.replace('%', '')) / 100
}
}
}
</script>
<style scoped>
.rightbl{
display: inline-block;
}
.slider-bg{
width:200px;
height:10px;
display: inline-block;
vertical-align: middle;
border-radius: 5px;
background: #ccc;
position: relative;
}
.slider-color{
position: absolute;
top:0;
left:0;
height:10px;
border-radius: 5px;
background: #f00;
}
.bl{
vertical-align: middle;
display: inline-block
}
</style>