A Vue.js component mixin that makes restoring initial state to the component simple.
yarn add @ianwalter/vue-component-reset
import vueComponentReset from '@ianwalter/vue-component-reset'
const resetMixin = vueComponentReset(() => ({ msg: 'Hello', count: 0 }))
export default {
mixins: [resetMixin],
methods: {
someAction () {
this.reset() // Reset data to it's initial state.
this.reset('msg') // Reset msg to it's initial state.
}
}
}
vuex-reset
][vuexResetUrl] - A Vuex plugin that makes restoring initialA Vue.js component mixin that makes restoring initial state to the component simple — Read More
Latest commit to the master branch on 6-28-2020
#state #vue #vuejs #programming