parent
de64853cc2
commit
4db8e935d1
@ -1,12 +1,42 @@
|
||||
.fontWeight {
|
||||
.loveflow {
|
||||
/* 定位 START */
|
||||
.absolute {
|
||||
position: absolute;
|
||||
}
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.flex-center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
/* 定位 END */
|
||||
|
||||
/* 间距 START*/
|
||||
.mt6 {
|
||||
margin-top: 6px;
|
||||
}
|
||||
.mr6 {
|
||||
margin-right: 6px;
|
||||
}
|
||||
/* 间距 END*/
|
||||
|
||||
/* 字体 START */
|
||||
.fontWeight {
|
||||
font-weight: bold;
|
||||
}
|
||||
.textGreen {
|
||||
}
|
||||
.textGreen {
|
||||
color: green;
|
||||
}
|
||||
.textRed {
|
||||
}
|
||||
.textRed {
|
||||
color: red;
|
||||
}
|
||||
.textBlue {
|
||||
}
|
||||
.textBlue {
|
||||
color: blue;
|
||||
}
|
||||
/* 字体 END */
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<div class="chartline">
|
||||
<div ref="dom" class="chartline1"></div>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
echartdata: {},
|
||||
notMerge: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dom: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
resize() {
|
||||
this.dom.resize();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
// this.dom = echarts.init(this.$refs.dom, "dark");
|
||||
|
||||
window.addEventListener("resize", this.resize, false);
|
||||
setTimeout(() => {
|
||||
this.dom = this.$echarts.init(this.$refs.dom);
|
||||
this.dom.setOption(this.echartdata, this.notMerge);
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.dom.dispose();
|
||||
window.removeEventListener("resize", () => {}, false);
|
||||
},
|
||||
watch: {
|
||||
echartdata: {
|
||||
handler(newval) {
|
||||
// setTimeout(() => {
|
||||
if (this.dom) {
|
||||
this.dom.setOption(this.echartdata, this.notMerge);
|
||||
}
|
||||
|
||||
// }, 1000);
|
||||
},
|
||||
deep: true,
|
||||
// immediate: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.chartline {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.chartline1 {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue