tested shared Vuex store, created d8 userblock, enabled JSONAPI module
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
<template lang="html">
|
||||
<div id="block-pagetitle" class="">
|
||||
<h1>Test Shared Store ( logged in: {{ isloggedin }} )</h1>
|
||||
<h2 v-if="isloggedin">Shared store is working</h2>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapActions } from 'vuex'
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
token: state => state.User.token,
|
||||
isloggedin: state => state.User.isloggedin
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
@ -1,5 +1,5 @@
|
||||
<template lang="html">
|
||||
<UserTools v-if="token" />
|
||||
<UserTools v-if="isloggedin" />
|
||||
<Login v-else />
|
||||
</template>
|
||||
|
||||
@ -15,7 +15,7 @@ export default {
|
||||
// },
|
||||
computed: {
|
||||
...mapState({
|
||||
token: state => state.User.token
|
||||
isloggedin: state => state.User.isloggedin
|
||||
})
|
||||
},
|
||||
components: {
|
||||
|
Reference in New Issue
Block a user