Support for Vue 3
See original GitHub issueI’m using Vue 3 + Typescript with vue /cli
, but I’m not getting it to work.
/store/counter.ts
import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators'
@Module
export default class Counter extends VuexModule {
count = 0
get $count() {
return this.count
}
@Mutation
INCREMENT(number: number) {
this.count += number
}
@Action
increment() {
this.context.commit('INCREMENT')
}
}
/store/index.ts
import { createStore } from 'vuex'
import counter from '@/store/counter'
export default createStore({
state: {},
modules: {
counter
}
})
any suggestion?
vuex-module-decorators
still don’t support Vue 3?
I read several times @championswimmer saying that I was waiting for vue 3 to be released to update the package, but it has already been released, already it will launch Nuxt 3 too … I would love to use vuex-module-decorators
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:10
Top Results From Across the Web
Frequently Asked Questions - Vue.js
What browsers does Vue support? # ... The latest version of Vue (3.x) only supports browsers with native ES2015 support. This excludes IE11....
Read more >Vue.js 3 support - BootstrapVue
Quickly integrate Bootstrap v4 components with Vue.js. ... @vue/compat support is designed for early migration to Vue.js 3 and will be eventually replaced ......
Read more >Which UI Frameworks Support Vue 3? - In Plain English
Amplify UI is a component library (38 components) with support for Vue 3 and focus on Amazon AWS compatibility.
Read more >Vue 3 – A roundup of infos about the new version of Vue.js
This version will be available as a LTS (long-term support) version for 18 months, which means that it will still get security updates...
Read more >The best UI frameworks for Vue 3 - LogRocket Blog
BalmUI features support for Vue 3 since its version 9.0. Balm is based on Google's Material Design, which is why it may look...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Make yourself a favor and stay away from vuex and this module when using vue 3 and just use the composition api (if possible)
@ndup0nt The composition API doesn’t make this package less useful. It exposes vue reactivity system outside of components, with that you can create your own state and modules on simple .ts files, with full Typescript support, if you’re tired of fighting vuex lack of proper typescript support and you don’t depend on vuex and its plugins you might as well just write your own simple and easily testable “store”.
I have written a big application with Vue 2 + vuex + vuex-module-decorators but issues such as: https://github.com/championswimmer/vuex-module-decorators/issues/304 https://github.com/championswimmer/vuex-module-decorators/issues/125 https://github.com/championswimmer/vuex-module-decorators/issues/277 and other made it quite a pain, but i sticked to this lib because as far as i know there is no mature state management library for vue2 with ts support, but you don’t need one in vue3