@thesold/x-model
v1.0.1
Published
A renderless Vue component to be used with Vuex instead of v-model
Downloads
1
Readme
X-Model
Authors:
Overview
Vue.js renderless component to work with Vuex when v-model is not suitable because changes should be commited via mutations. X-model will disconnect the v-model passed in and make it non-reactive allowing you to listen to the updated event to commit changes to your Vuex Store.
Installation
npm install @thesold/x-model
import XModel from '@thesold/x-model'
Vue.component(XModel)
Usage
<x-model :value="reactiveProp" @input="updateModel">
<template slot-scope="{ frozenValue }">
<!-- input/updateModel will be fired when frozenValue is changes, however reactiveProp will not receive any updates from the component -->
</template>
</x-model>