<el-form-item prop="a" :label="'一楼:'">
<geoJson />
</el-form-item>
<el-form-item prop="a" :label="'二楼:'">
<geoJson />
</el-form-item>
//如有页面需要多次调用,使用document.getElementById不能多次初始化,只会显示一个
//用this.$refs.myChart 或者currentInstance.ctx.$refs.myChart
import { getCurrentInstance, onMounted } from '@vue/runtime-core'
setup(){
onMounted(() => {
currentInstance = getCurrentInstance()
})
const initGeo = (num) => {
var dom = currentInstance.ctx.$refs.myChart
const myChart = echarts.init(dom)
}
}
网友评论