-
Hi again! I am trying something, IDK if it is possible. What I am trying is using a "v-if" to print something only if the roles are assigned. It seems that access to this.$store.state.players is possible is a VueJS, but not in the template. Is there some way? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can map a state property into the component like this: https://github.com/bra1n/townsquare/blob/develop/src/components/Player.vue#L223 |
Beta Was this translation helpful? Give feedback.
-
Hum... It is harder than I thought. OK, tanks, now I can access to the list of players, and look at the first one. But how can I check if they have a role? I tried EDIT: Oh, I just found the issue. No problem now. Thanks again ! |
Beta Was this translation helpful? Give feedback.
You can map a state property into the component like this: https://github.com/bra1n/townsquare/blob/develop/src/components/Player.vue#L223
And then use it in the template like this:
https://github.com/bra1n/townsquare/blob/develop/src/components/Player.vue#L88