vue init webpack stockspec
PS D:\codes\vue\stockspec_vue> vue init webpack stockspec
? Project name stockspec
? Project description A Vue.js project
? Author mmdfish
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm
vue-cli · Generated "stockspec".
实现
引入Element-ui
```
// stockspec/src/main.js
import ElementUI from ‘element-ui’
import ‘element-ui/lib/theme-chalk/index.css’
Vue.use(ElementUI)
- 引入Highcharts的highstock
// stockspec/src/main.js
import HighchartsVue from ‘highcharts-vue’
import Highcharts from ‘highcharts’
import stockInit from ‘highcharts/modules/stock’
```
5. 其他
stockspec/src/component/common.vue
一些通用的方法和常量,包括中英文的Dictionary spec_dict,显示数据的精度getDisplayValueScope和getDisplayValue,用export default导出
```
```
在其他vue中调用
```
import common from './common.vue'
common.getDisplayValue(name,value)
let specdict = common.spec_dict
```
关于el-table和highcharts在本项目的应用,后续会再写。
# 运行
如果前两个python项目都正常运行的话,从github clone之后应该是能直接看到运行效果的。
```
cd stockspec
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
```