Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt 3 Vuex workaround #44

Open
chiboreache opened this issue Jan 29, 2019 · 13 comments
Open

Nuxt 3 Vuex workaround #44

chiboreache opened this issue Jan 29, 2019 · 13 comments

Comments

@chiboreache
Copy link

Hi!
Since Nuxt 2 already warning us about deprecating classic way of doing Vuex, so my question is:

how to make neat store.set('foo/bar') work again
without import store from './store/index' ?

@davestewart
Copy link
Owner

What's their new plan?

@davestewart
Copy link
Owner

davestewart commented Feb 1, 2019

I asked a question here:

@chiboreache
Copy link
Author

chiboreache commented Feb 1, 2019

lol

you have to enabling plugins in nuxt.config.js in plugins: []

their new plan

is to make it nice and clean, obviously heh

Modules: every .js file inside the store directory is transformed as a namespaced module (index being the root module).
The store will be created as such: blah-blah

go through the link above

@davestewart
Copy link
Owner

OK, so as long as the plugin's install() method is called, passing an instance of store, it should just work:

@davestewart
Copy link
Owner

@chiboreache - did you have any more info on this? Is this still an issue I need to handle?

@chiboreache
Copy link
Author

chiboreache commented Mar 19, 2019

@davestewart I just got bogged down in routine (and python), sorru =)

but I'm finally back, and I already tired from getters and mappers, so yeah, I will dig in at this week 💯

@davestewart
Copy link
Owner

I know the feeling! (of getting bogged down)

@chiboreache
Copy link
Author

LOL

i fixed it.

Screenshot_20190323_163300

@chiboreache
Copy link
Author

chiboreache commented Mar 23, 2019

but there is an error in 2.4 version (with 1.4 from example project all fine)
and it's brakes hot-reload ~_~

so yeah, that wasn't hard, heh:

import pathify from 'vuex-pathify'
import hello from './modules/hello'

console.log('STORE FILE LOADED!')

export const plugins = [ pathify.plugin ]
export const modules = { hello }
export const actions = {
  nuxtServerInit(context, value) {
    console.log('NUXT_SERVER_INIT!')
  }
}

this is thrue Module mode index.js ;)

I can pr you fully loaded coffeescript variant, just a little bit later =)

@davestewart
Copy link
Owner

So what was the final conclusion?

Does Pathify need updates to code or docs?

@chiboreache
Copy link
Author

chiboreache commented Apr 8, 2019

Yeah, of course it would be nice, since Nuxt going that(modules) way.

When I finally figuring out how to PR properly, I will push you coffee example ;)

@imranaalam
Copy link

is this being used with NUXT? as of today. new NUXT with vue 3 is releasing today...

@davestewart
Copy link
Owner

Not sure. I'll reopen the issue...

@davestewart davestewart reopened this Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants