Skip to content
This repository was archived by the owner on Apr 25, 2020. It is now read-only.

Commit bf84bdd

Browse files
committed
Differentiate global and local installation
1 parent db5708a commit bf84bdd

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

README.md

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,54 @@ with CSS.
1515

1616
## Installation
1717

18-
1. Install package using `yarn` or `npm`:
18+
### yarn / npm
1919

20-
```sh
21-
$ yarn add vue-float-label
20+
Install package using `yarn` or `npm`:
2221

23-
# or
22+
```sh
23+
$ yarn add vue-float-label
2424

25-
$ npm install --save vue-float-label
26-
```
25+
# or
2726

28-
2. Load the plugin by calling `Vue.use()`:
27+
$ npm install --save vue-float-label
28+
```
2929

30-
```js
31-
import Vue from 'vue'
32-
import VueFloatLabel from 'vue-float-label'
30+
#### Global
3331

34-
Vue.use(VueFloatLabel)
35-
```
32+
Load the plugin by calling `Vue.use()`:
33+
34+
```js
35+
import Vue from 'vue'
36+
import VueFloatLabel from 'vue-float-label'
37+
38+
Vue.use(VueFloatLabel)
39+
```
3640

37-
3. Now you have access in your templates to the `<float-label>` component.
41+
Now you have access in your templates to the `<float-label>` component.
42+
43+
#### Local
44+
45+
You may prefer to explicitly import the plugin and use it inside your components:
46+
47+
```vue
48+
<template>
49+
<div>
50+
<float-label>
51+
...
52+
</float-label>
53+
</div>
54+
</template>
55+
56+
<script>
57+
import FloatLabel from 'vue-float-label/components/FloatLabel'
58+
59+
export default {
60+
components: {
61+
FloatLabel
62+
}
63+
}
64+
</script>
65+
```
3866

3967
## Usage
4068

0 commit comments

Comments
 (0)