File tree 1 file changed +33
-3
lines changed
1 file changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -98,9 +98,15 @@ npm install @vueform/toggle
98
98
<style src="@vueform/toggle/themes/default.css"></style>
99
99
```
100
100
101
- ## Usage with Vue 2
101
+ ## Using with Vue 2
102
102
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:
104
110
105
111
``` js
106
112
import Vue from ' vue'
@@ -109,7 +115,31 @@ import VueCompositionAPI from '@vue/composition-api'
109
115
Vue .use (VueCompositionAPI)
110
116
```
111
117
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:
113
143
114
144
``` js
115
145
import Toggle from ' @vueform/toggle/dist/toggle.vue2.js'
You can’t perform that action at this time.
0 commit comments