fix readme

This commit is contained in:
Justineo
2016-06-17 19:00:05 +08:00
parent d2af62f3c5
commit 55ff94077d

View File

@ -7,7 +7,7 @@ Built upon ECharts 3.x & Vue.js 1.x.
## Installation ## Installation
### ### Manual
Just download `dist/vue-echarts.js` and include it in your HTML file: Just download `dist/vue-echarts.js` and include it in your HTML file:
@ -41,7 +41,7 @@ var ECharts = require('path/to/vue-echarts/dist/vue-echarts')
var ECharts = require('path/to/vue-echarts/src/components/ECharts.vue') var ECharts = require('path/to/vue-echarts/src/components/ECharts.vue')
// register component to use // register component to use
Vue.component('chart', ECharts); Vue.component('chart', ECharts)
``` ```
### AMD ### AMD
@ -49,12 +49,14 @@ Vue.component('chart', ECharts);
```js ```js
require.config({ require.config({
paths: { paths: {
'vue': 'path/to/vue',
'vue-echarts': 'path/to/vue-conticon/dist/vue-echarts' 'vue-echarts': 'path/to/vue-conticon/dist/vue-echarts'
} }
}) })
require(['vue-echarts'], function (ECharts) { require(['vue', 'vue-echarts'], function (Vue, ECharts) {
// register component to use... // register component to use
Vue.component('chart', ECharts)
}) })
``` ```
@ -62,6 +64,11 @@ require(['vue-echarts'], function (ECharts) {
The component class is exposed as `window.VueECharts`. The component class is exposed as `window.VueECharts`.
```js
// register component to use
Vue.component('chart', VueECharts)
```
## Using the component ## Using the component
```vue ```vue