wente
2024-11-13 40b60ccb89d6d50b0ccc577937f462360c7c2d4d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* eslint-disable */
const globalData = {}
export default {
    chart: {
        inserted(el, binding) {
            let chartType = el.getAttribute(`data-chartType`)
            globalData[el.getAttribute(`data-chartKey`)] = echarts.init(
                el, null, {
                    renderer: chartType,
                    width: el.clientWidth,
                    height: el.clientHeight
                }
            )
            globalData[el.getAttribute(`data-chartKey`)].setOption(binding.value, {notMerge: true,})
        },
        update(el, binding) {
            globalData[el.getAttribute(`data-chartKey`)].setOption(binding.value, {notMerge: true,})
        }
    }
}