You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+72-70Lines changed: 72 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -319,6 +319,78 @@ See more examples [here](https://github.com/ecomfe/vue-echarts/tree/main/src/dem
319
319
320
320
For performance critical scenarios (having a large dataset) we'd better bypass Vue's reactivity system for `option` prop. By specifying `manual-update` prop with `true` and not providing `option` prop, the dataset won't be watched any more. After doing so, you need to retrieve the component instance with `ref` and manually call `setOption` method to update the chart.
See supported events [here →](https://echarts.apache.org/en/api.html#events)
383
+
384
+
#### Native DOM Events
385
+
386
+
As Vue-ECharts binds events to the ECharts instance by default, there is some caveat when using native DOM events. You need to prefix the event name with `native:` to bind native DOM events (or you can use the `.native` modifier in Vue 2, which is dropped in Vue 3).
387
+
388
+
```vue
389
+
<template>
390
+
<v-chart @native:click="handleClick" />
391
+
</template>
392
+
```
393
+
322
394
### Provide / Inject
323
395
324
396
Vue-ECharts provides provide/inject API for `theme`, `init-options`, `update-options` and `loading-options` to help configuring contextual options. eg. for `init-options` you can use the provide API like this:
@@ -402,76 +474,6 @@ import { THEME_KEY } from 'vue-echarts'
402
474
403
475
Static methods can be accessed from [`echarts` itself](https://echarts.apache.org/en/api.html#echarts).
See supported events [here →](https://echarts.apache.org/en/api.html#events)
466
-
467
-
#### Native DOM Events
468
-
469
-
```vue
470
-
<template>
471
-
<v-chart @native:click="handleClick" />
472
-
</template>
473
-
```
474
-
475
477
## CSP: `style-src` or `style-src-elem`
476
478
477
479
If you are applying a CSP to prevent inline `<style>` injection, you need to use files from `dist/csp` directory and include `dist/csp/style.css` into your app manually.
0 commit comments