update 添加echarts
This commit is contained in:
parent
cb42929de4
commit
c294262cda
@ -17,6 +17,11 @@ module.exports = {
|
||||
target: 'http://demo.open.renren.io',
|
||||
changeOrigin: true
|
||||
},
|
||||
'/sys': {
|
||||
// target: 'http://demo.open.renren.io',
|
||||
target: 'http://10.0.1.180:8001',
|
||||
changeOrigin: true
|
||||
},
|
||||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>数字化管理系统</title>
|
||||
<script src="./static/plugins/mock-1.0.0-beta3/mock-min.js"></script>
|
||||
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts-all-3.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
13
package-lock.json
generated
13
package-lock.json
generated
@ -3827,6 +3827,14 @@
|
||||
"safer-buffer": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"echarts": {
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://registry.npmjs.org/echarts/-/echarts-4.7.0.tgz",
|
||||
"integrity": "sha512-NlOTdUcAsIyCCG+N4uh0ZEvXtrPW2jvcuqf03RyqYeCKzyPbiOQ4I3MdKXMhxG3lBdqQNdNXVT71SB4KTQjN0A==",
|
||||
"requires": {
|
||||
"zrender": "4.3.0"
|
||||
}
|
||||
},
|
||||
"editorconfig": {
|
||||
"version": "0.15.3",
|
||||
"resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz",
|
||||
@ -19771,6 +19779,11 @@
|
||||
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"zrender": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/zrender/-/zrender-4.3.0.tgz",
|
||||
"integrity": "sha512-Dii6j2bDsPkxQayuVf2DXJeruIB/mKVxxcGRZQ9GExiBd4c3w7+oBuvo1O/JGHeFeA1nCmSDVDs/S7yKZG1nrA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,12 +11,14 @@
|
||||
"e2e": "node test/e2e/runner.js",
|
||||
"test": "npm run unit && npm run e2e",
|
||||
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
|
||||
"build": "gulp"
|
||||
"build": "node build/build.js",
|
||||
"gulp": "gulp"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.19.2",
|
||||
"babel-plugin-component": "0.10.1",
|
||||
"babel-polyfill": "6.26.0",
|
||||
"echarts": "^4.7.0",
|
||||
"element-ui": "^2.13.1",
|
||||
"gulp": "3.9.1",
|
||||
"gulp-concat": "2.6.1",
|
||||
|
||||
@ -15,9 +15,9 @@ Vue.use(VueCookie)
|
||||
Vue.config.productionTip = false
|
||||
|
||||
// 非生产环境, 适配mockjs模拟数据 // api: https://github.com/nuysoft/Mock
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
require('@/mock')
|
||||
}
|
||||
// if (process.env.NODE_ENV !== 'production') {
|
||||
// require('@/mock')
|
||||
// }
|
||||
|
||||
// 挂载全局
|
||||
Vue.prototype.$http = httpRequest // ajax请求方法
|
||||
|
||||
@ -1,5 +1,39 @@
|
||||
<template>
|
||||
<div class="staff-archives">
|
||||
员工档案
|
||||
<div id="myChart" :style="{width: '300px', height: '300px'}"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.handleDrawLine()
|
||||
},
|
||||
methods: {
|
||||
handleDrawLine () {
|
||||
let myChart = echarts.init(document.getElementById('myChart'))
|
||||
// 绘制图表
|
||||
myChart.setOption({
|
||||
title: { text: '在Vue中使用echarts' },
|
||||
tooltip: {},
|
||||
xAxis: {
|
||||
data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
|
||||
},
|
||||
yAxis: {},
|
||||
series: [{
|
||||
name: '销量',
|
||||
type: 'bar',
|
||||
data: [5, 20, 36, 10, 10, 20]
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user