Skip to content

Commit 94fe0e5

Browse files
authored
fix: update readme
1 parent e34858b commit 94fe0e5

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

README.md

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,52 @@
5353
A Vue.js component that turns a Mermaid string into a diagram.
5454
<!-- /DESCRIPTION -->
5555

56-
<!-- INSTALL/ -->
57-
## Install
58-
56+
## Install Via a Package Manager
5957
```bash
6058
# npm
6159
$ npm install vue-mermaid-string
6260

6361
# Yarn
6462
$ yarn add vue-mermaid-string
6563
```
66-
<!-- /INSTALL -->
64+
65+
Add to Local Components:
66+
67+
```js
68+
export default {
69+
import VueMermaidString from 'vue-mermaid-string'
70+
71+
components: {
72+
VueMermaidString,
73+
},
74+
}
75+
```
76+
77+
Or register as global component:
78+
79+
```js
80+
import Vue from 'vue'
81+
import VueMermaidString from 'vue-mermaid-string'
82+
83+
Vue.component('VueMermaidString', VueMermaidString)
84+
```
85+
86+
Or register as plugin:
87+
88+
```js
89+
import Vue from 'vue'
90+
import VueMermaidString from 'vue-mermaid-string'
91+
92+
Vue.use(VueMermaidString)
93+
```
94+
95+
## Install Via CDN
96+
97+
```html
98+
<script src="https://unpkg.com/vue"></script>
99+
<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>
100+
<script src="https://unpkg.com/vue-mermaid-string"></script>
101+
```
67102

68103
## Usage
69104

@@ -77,12 +112,7 @@ Usage is simple, you pass a Mermaid string to the component and you get a visual
77112

78113
```js
79114
<script>
80-
import VueMermaidString from 'vue-mermaid-string'
81-
82115
export default {
83-
components: {
84-
VueMermaidString,
85-
},
86116
computed: {
87117
diagram: () => 'graph TD\n A --> B',
88118
},

0 commit comments

Comments
 (0)