Skip to content

Commit 4058ea7

Browse files
committed
readme update
1 parent 71f70b8 commit 4058ea7

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,15 @@ npm install @vueform/toggle
9898
<style src="@vueform/toggle/themes/default.css"></style>
9999
```
100100

101-
## Usage with Vue 2
101+
## Using with Vue 2
102102

103-
When using with Vue 2 install [@vue/composition-api](https://github.com/vuejs/composition-api#npm) first:
103+
When using Vue 2 install [@vue/composition-api](https://github.com/vuejs/composition-api#npm) via npm/yarn first:
104+
105+
``` bash
106+
npm i @vue/composition-api --save-dev
107+
```
108+
109+
Then install the plugin for Vue:
104110

105111
``` js
106112
import Vue from 'vue'
@@ -109,7 +115,31 @@ import VueCompositionAPI from '@vue/composition-api'
109115
Vue.use(VueCompositionAPI)
110116
```
111117

112-
Then make sure to change the imported module to:
118+
After that make sure to change the imported Toggle module to:
119+
120+
``` js
121+
import Toggle from '@vueform/toggle/dist/toggle.vue2.js'
122+
```
123+
124+
## Using with Nuxt.js
125+
126+
First you need install [@nuxtjs/composition-api](https://composition-api.nuxtjs.org/getting-started/setup):
127+
128+
``` bash
129+
npm i @nuxtjs/composition-api --save-dev
130+
```
131+
132+
Then you need to enable it as a module in `nuxt.config.js`:
133+
134+
``` js
135+
{
136+
buildModules: [
137+
'@nuxtjs/composition-api'
138+
]
139+
}
140+
```
141+
142+
After that make sure to change the imported module to Vue 2 version of Toggle, as Nuxt.js still depends on that:
113143

114144
``` js
115145
import Toggle from '@vueform/toggle/dist/toggle.vue2.js'

0 commit comments

Comments
 (0)