Installation
Requirements
| Dependency | Minimum version | Needed for |
|---|---|---|
| Vue | 3.0+ | Everything (only required peer) |
| Node.js | 18+ | Build/dev tooling, CLI |
@nuxt/kit | 3.0+ | The Nuxt module (vue-feature-toggles/nuxt), optional peer |
@vue/devtools-api | 7.0+ | Vue DevTools browser-extension integration, optional peer |
vite is not a peer dependency of the package — vue-feature-toggles/vite is a plain Vite plugin, so it only needs whatever vite your project already has installed as a build tool.
Installation
bash
npm install vue-feature-togglesQuick start
ts
// main.ts
import { createApp } from 'vue'
import { FeatureToggles } from 'vue-feature-toggles'
import App from './App.vue'
const app = createApp(App)
app.use(FeatureToggles, {
flags: {
newDashboard: true,
betaSearch: false,
darkMode: true,
},
})
app.mount('#app')vue
<Feature name="newDashboard">
<NewDashboard />
</Feature>See Vue Plugin & Options for the full set of plugin options, or Nuxt Module for Nuxt 3 usage.