davestewart / vuex-pathify

Vue / Vuex plugin providing a unified path syntax to Vuex stores
https://davestewart.github.io/vuex-pathify
MIT License
1.37k stars 57 forks source link

Nuxt 3 Vuex workaround #44

Open chiboreache opened 5 years ago

chiboreache commented 5 years ago

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 commented 5 years ago

What's their new plan?

davestewart commented 5 years ago

I asked a question here:

chiboreache commented 5 years ago

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 commented 5 years ago

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

davestewart commented 5 years ago

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

chiboreache commented 5 years ago

@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 :100:

davestewart commented 5 years ago

I know the feeling! (of getting bogged down)

chiboreache commented 5 years ago

LOL

i fixed it.

Screenshot_20190323_163300

chiboreache commented 5 years ago

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 commented 5 years ago

So what was the final conclusion?

Does Pathify need updates to code or docs?

chiboreache commented 5 years ago

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 commented 3 years ago

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

davestewart commented 3 years ago

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