Skip to content

DerekAlanGilbert/vue-feature

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic usage

Lightweight directive and instance method in vuejs for feature toggling based on configuration keys in your feature.config.js file.

In your feature.config.js

export default {
	'specific-feature-toggle': {
		status: true
	}
}

In your main.js

import vueFeature from 'vue-feature'
import config from '../path-to-config/feature.config'

Vue.use(vueFeature,config)

In your markup

<div v-feature:specific-feature-toggle>
</div>

In your javascript

mounted(){
  this.$feature('specific-feature-toggle') ? this.dothis() : this.doThat()
}