3.0.1 • Published 9 months ago
@zhourengui/vue3redux v3.0.1
Vue3Redux
Provide Hooks for projects using Redux in Vue3
Installation
npm install @zhourengui/vue3redux
# or
yarn add @zhourengui/vue3redux
Basic Example
Install @zhourengui/vue3redux
plugin
import { createApp } from '@vue/runtime-dom';
import { createVue3redux } from '@zhourengui/vue3redux';
import App from './app.vue';
import { store } from './stores';
const vue3redux = createVue3redux();
const app = createApp(App);
app.use(vue3redux, { store: store });
app.mount('#app');
Used @zhourengui/vue3redux
in component
<template>
<p>Count is: {{ counter }}</p>
<button @click="() => dispatch(increment())">Increment Count</button>
<button @click="() => dispatch(decrement())">Decrement Count</button>
<button @click="() => dispatch(incrementByAmount(100))">
Increment By Amount
</button>
<p>Author: {{ author.name }}, {{ author.github }}</p>
<button
@click="
() =>
dispatch(
restoreAuthor({
name: `Rengui Zhou ${Math.random()}`,
github: 'https://github.com/zhourengui',
})
)
"
>
Change Author
</button>
</template>
<script setup lang="ts">
import { useSelector, useDispatch } from '@zhourengui/vue3redux';
import {
increment,
decrement,
incrementByAmount,
RootState,
demoSlice,
restoreAuthor,
} from './stores';
const { counter, author } = useSelector(
(store: RootState) => store[demoSlice.name]
);
const dispatch = useDispatch();
</script>
Examples
Todo List
- Add Tests
2.0.0
9 months ago
3.0.1
9 months ago
3.0.0
9 months ago
1.3.7
1 year ago
1.3.6
1 year ago
1.3.5
1 year ago
1.3.4
1 year ago
1.3.3
1 year ago
1.3.2
1 year ago
1.3.1
1 year ago
1.3.0
1 year ago
1.2.17
1 year ago
1.2.16
1 year ago
1.2.15
1 year ago
1.2.13
1 year ago
1.2.12
1 year ago
1.2.11
1 year ago
1.2.10
1 year ago
1.2.9
1 year ago
1.2.7
1 year ago
1.2.8
1 year ago
1.2.6
1 year ago
1.2.5
1 year ago
1.2.4
1 year ago
1.2.3
1 year ago
1.2.2
1 year ago
1.2.1
1 year ago
1.2.0
1 year ago
1.0.0
1 year ago
1.1.1
1 year ago
1.1.0
1 year ago
1.0.22
1 year ago
1.0.21
1 year ago
1.0.20
1 year ago
1.0.18
1 year ago
1.0.17
1 year ago
1.0.16
1 year ago
1.0.15
1 year ago
1.0.14
1 year ago
1.0.13
1 year ago
1.0.12
1 year ago
1.0.11
1 year ago
1.0.10
1 year ago
1.0.9
1 year ago
1.0.8
1 year ago
1.0.7
1 year ago
1.0.6
1 year ago
1.0.5
1 year ago
1.0.4
1 year ago
1.0.3
1 year ago
1.0.2
1 year ago
1.0.1
1 year ago