Skip to content

Commit 268f113

Browse files
authored
docs: update readme (#176)
1 parent f0863a7 commit 268f113

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,36 @@
55

66
Reactive Vue.js wrapper for Google Charts lib
77

8-
## Table of contents
9-
10-
- [Installation](#installation)
11-
- [Usage](#usage)
12-
- [Example](#example)
8+
<br />
9+
<a href="#installation">Installation</a>
10+
<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
11+
<a href="#usage">Usage</a>
12+
<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
13+
<a href="https://slack.cube.dev/?ref=eco-vue-google-charts">Slack</a>
14+
<br />
15+
<hr />
1316

1417
# Installation
1518

16-
```
19+
```bash
20+
pnpm add vue-google-charts
21+
# or
22+
yarn add vue-google-charts
23+
# or
1724
npm i vue-google-charts
1825
```
1926

20-
## Default import
27+
<hr />
2128

22-
Install a component globally (use as plugin):
29+
Need an API to fetch data? Consider [Cube](https://cube.dev/?ref=eco-vue-google-charts), an open-source API for data apps.
2330

24-
```javascript
25-
import Vue from 'vue'
26-
import VueGoogleCharts from 'vue-google-charts'
31+
<br />
2732

28-
Vue.use(VueGoogleCharts)
29-
```
33+
[![supported by Cube](https://user-images.githubusercontent.com/986756/154330861-d79ab8ec-aacb-4af8-9e17-1b28f1eccb01.svg)](https://cube.dev/?ref=eco-vue-google-charts)
34+
35+
## Default import
36+
37+
This package works with version 2.x and 3.x of Vue.
3038

3139
Use locally in a component:
3240

@@ -40,15 +48,12 @@ export default {
4048
}
4149
```
4250

43-
## Browser
51+
For Vue 2 projects, you need to import from `vue-google-charts/legacy`.
4452

45-
```html
46-
<script src="vue.js"></script>
47-
<script src="vue-google-charts/dist/vue-google-charts.browser.js"></script>
53+
```javascript
54+
import { GChart } from 'vue-google-charts/legacy'
4855
```
4956

50-
The plugin should be auto-installed. If not, you can install it manually with the instructions below.
51-
5257
# Usage
5358

5459
## Read the Google Charts docs first

0 commit comments

Comments
 (0)