You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.2 KiB

6 years ago
<template>
<el-row
class="card-panel"
type="flex"
justify="space-between"
6 years ago
@mouseout.native="mouseout"
@mouseover.native="mouseover"
6 years ago
>
<div class="card-panel-icon-wrapper" :style="style">
<svg-icon :icon="icon" class-name="card-panel-icon"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">{{text}}</div>
<count-to class="card-panel-num" :duration="2000" :end-val="value" :start-val="0"/>
</div>
</el-row>
</template>
<script>
import CountTo from 'vue-count-to'
export default {
name: "PanelGroupItem",
components: {CountTo},
props: {
icon: String,
color: String,
text: String,
value: Number
},
data() {
return {
style: 'color:' + this.color
}
6 years ago
},
methods: {
mouseout() {
this.style = 'color:' + this.color
},
mouseover() {
this.style = 'background:' + this.color
}
6 years ago
}
}
</script>
6 years ago
<style lang="scss" src="./PanelGroupItem.scss"></style>