Closed bolasblack closed 6 years ago
Why doesn't it expected? It would bind to userInfo
namespace.
I'm so sorry to reply so late. I used to be too busy in the past to have the energy to check the code.
At last I found it's my fault, the vuex version I am using is too old to work with newest vuex-class.
In 2.0.0 vue use this.$store.state[val]
to search namespace, so I think the argument vuex-class generated may wrong:
https://github.com/vuejs/vuex/blob/cca2c4b19b7656ea4632d47c39640da68d94c239/src/helpers.js#L7
Just now I found newest vuex has changed the way to search namespace:
Now my problem has resolved. Thanks for your work :P
And apologize again for my recklessness.
Hi, I'm reading the code, and I found the code in function
extractNamespace
https://github.com/ktsn/vuex-class/blob/ddefbb3f125f174beb3678067423bf4a2966f412/src/bindings.ts#L128-L130
will append
/
to the tail of namespace.So if I call
@State('name', { namespace: 'userInfo' })
, it will executemapState('userInfo/', { [...]: 'name' })
I think this isn't what I expected.
Did I missed any thing?