文件名从 CodeManagement/BigScreenVue/src/common/echart/index.vue 修改 |
| | |
| | | <!-- |
| | | * @Author: daidai |
| | | * @Date: 2022-02-28 16:29:08 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2022-09-27 15:05:45 |
| | | * @FilePath: \web-pc\src\pages\big-screen\components\echart\index.vue |
| | | --> |
| | | <template> |
| | | <div :id="id" :class="className" :style="{ height: height, width: width }" /> |
| | | </template> |
| | | |
| | | <script> |
| | | import tdTheme from './theme.json' // 寮曞叆榛樿涓婚 |
| | | import '../map/fujian.js' |
| | | |
| | | import * as echarts from 'echarts'; |
| | | export default { |
| | | name: 'echart', |
| | | props: { |
| | |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default: '2.5rem' |
| | | default: '100%' |
| | | }, |
| | | options: { |
| | | type: Object, |
| | |
| | | } |
| | | }, |
| | | mounted () { |
| | | this.$echarts.registerTheme('tdTheme', tdTheme); // 瑕嗙洊榛樿涓婚 |
| | | this.initChart(); |
| | | }, |
| | | beforeDestroy () { |
| | |
| | | methods: { |
| | | initChart () { |
| | | // 鍒濆鍖杄chart |
| | | this.chart = this.$echarts.init(this.$el, 'tdTheme') |
| | | this.chart = echarts.init(this.$el) |
| | | this.chart.setOption(this.options, true) |
| | | } |
| | | } |