0.1.6 • Published 5 years ago
@nqdm-cfinnigan/vuex-counter v0.1.6
Vuex Counter
What it does
A configurable counter component which uses Vuex actions and getters
Props
by: How much you want to increment / decrement by [type: Number]
duration: If you want to add a time delay in milleseconds [type: Number]
counterGetter: The name of the Vuex getter you want to use to display your counter total [type: String]
incrementAction: The name of Vuex action you want to dispatch when clicking the increment button [type: String]
decrementAction: The name of Vuex action you want to dispatch when clicking the decrement button [type: String]
Example
<template>
<div id="app">
<Counter
:by='500'
:duration='100'
:counterGetter='"stringCounter"'
:incrementAction='"asyncIncrement"'
:decrementAction='"asyncDecrement"'
/>
<Counter
:by='1500'
:duration='100'
:counterGetter='"stringCounterDoubler"'
:incrementAction='"asyncIncrement"'
:decrementAction='"asyncDecrement"'
/>
</div>
</template>
<script>
import Counter from '@nqdm-cfinnigan/vuex-counter'
export default {
name: 'app',
components: {
Counter
}
}
</script>