fix[LineChart]: fixed transitionend bug (#1045)
Fixed https://github.com/PanJiaChen/vue-element-admin/issues/1036
This commit is contained in:
parent
2938e33d0e
commit
a03d1edac6
|
@ -56,7 +56,7 @@ export default {
|
||||||
|
|
||||||
// 监听侧边栏的变化
|
// 监听侧边栏的变化
|
||||||
const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
|
const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
|
||||||
sidebarElm.addEventListener('transitionend', this.__resizeHandler)
|
sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler)
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
|
@ -67,12 +67,17 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
|
const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
|
||||||
sidebarElm.removeEventListener('transitionend', this.__resizeHandler)
|
sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler)
|
||||||
|
|
||||||
this.chart.dispose()
|
this.chart.dispose()
|
||||||
this.chart = null
|
this.chart = null
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
sidebarResizeHandler(e) {
|
||||||
|
if (e.propertyName === 'width') {
|
||||||
|
this.__resizeHandler()
|
||||||
|
}
|
||||||
|
},
|
||||||
setOptions({ expectedData, actualData } = {}) {
|
setOptions({ expectedData, actualData } = {}) {
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
xAxis: {
|
xAxis: {
|
||||||
|
|
Loading…
Reference in New Issue