This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nezha-nezha-fronted/nezha-fronted/src/components/common/chartUnit.vue

53 lines
1.1 KiB
Vue
Raw Normal View History

2020-04-28 19:23:48 +08:00
<template>
<el-cascader filterable placeholder="" popper-class="no-style-class unit-pop-class" size="mini"
:options="chartUnits"
class="chart-unit"
:props="{ expandTrigger: 'click' ,emitPath:false}"
:show-all-levels="false"
v-model="unit"
@change="unitSelected"
>
</el-cascader>
</template>
<script>
import chartDataFormat from "../charts/chartDataFormat";
export default {
name: "chartUnit",
model:{
event:'change',
prop:'postUnit'
},
props:{
postUnit:{}
},
data(){
return{
chartUnits:chartDataFormat.unitOptions(),
visibel:false,
unit:0,
}
},
created() {
this.unit=this.postUnit;
},
methods:{
unitSelected:function(value){
this.unit=value;
this.$emit('change',this.unit);
},
}
}
</script>
<style >
.chart-unit{
width: 100px;
margin: 0 20px 0 0;
}
.unit-pop-class .el-cascader-panel{
height: 200px;
background-color: #FFF;
}
</style>