update echarts挂载全局

This commit is contained in:
yoe 2020-05-12 16:05:25 +08:00
parent c294262cda
commit c2e661b1a8
2 changed files with 3 additions and 3 deletions

View File

@ -10,6 +10,7 @@ import '@/assets/scss/index.scss'
import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
import { isAuth } from '@/utils'
// import cloneDeep from 'lodash/cloneDeep'
import echarts from 'echarts'
Vue.use(VueCookie)
Vue.config.productionTip = false
@ -20,6 +21,7 @@ Vue.config.productionTip = false
// }
// 挂载全局
Vue.prototype.$echarts = echarts // echarts画图
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.isAuth = isAuth // 权限方法

View File

@ -6,8 +6,6 @@
</template>
<script>
import echarts from 'echarts'
export default {
data () {
return {
@ -18,7 +16,7 @@ export default {
},
methods: {
handleDrawLine () {
let myChart = echarts.init(document.getElementById('myChart'))
let myChart = this.$echarts.init(document.getElementById('myChart'))
//
myChart.setOption({
title: { text: '在Vue中使用echarts' },