Skip to content

Commit 0394bf3

Browse files
committed
docs: add example for $apexcharts usage on Vue instance
1 parent f9258e5 commit 0394bf3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ export default {
4747
};
4848
```
4949

50+
To provide a `$apexcharts` reference inside Vue instance
51+
52+
```ts
53+
import ApexCharts from 'apexcharts';
54+
55+
app.config.globalProperties.$apexcharts = ApexCharts;
56+
57+
// Add this when into a TypeScript codebase
58+
declare module '@vue/runtime-core' {
59+
interface ComponentCustomProperties {
60+
$apexcharts: typeof ApexCharts;
61+
}
62+
}
63+
```
64+
5065
To create a basic bar chart with minimal configuration, write as follows:
5166

5267
```vue

0 commit comments

Comments
 (0)