question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Vue 3

See original GitHub issue

I’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
  }
})

A test image

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:open
  • Created 3 years ago
  • Reactions:4
  • Comments:10

github_iconTop GitHub Comments

14reactions
VitAndrGuidcommented, Feb 9, 2021

Make yourself a favor and stay away from vuex and this module when using vue 3 and just use the composition api (if possible)

9reactions
VitAndrGuidcommented, Feb 20, 2021

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found