Issue #151: Done.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<DspLogo />
|
||||
</figure>
|
||||
<div class="flex justify-between items-center" v-show="showMember">
|
||||
<button class="btn btn-sm btn-neutral mr-2" @click.prevent="logOut">
|
||||
<button class="btn btn-sm btn-neutral mr-2" @click.prevent="logOutButton">
|
||||
Logout
|
||||
</button>
|
||||
<!-- <figure>
|
||||
@@ -19,9 +19,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import loginStore from '@/stores/login.js';
|
||||
import DspLogo from '@/components/icons/DspLogo.vue';
|
||||
import IconMember from '@/components/icons/IconMember.vue';
|
||||
import AllMapDataStore from '@/stores/allMapData.js';
|
||||
import { logoutLeave } from '@/module/alertModal.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -32,15 +35,26 @@ export default {
|
||||
setup() {
|
||||
const store = loginStore();
|
||||
const { logOut } = store;
|
||||
const allMapDataStore = AllMapDataStore();
|
||||
const { tempFilterId, temporaryData, postRuleData, ruleData } = storeToRefs(allMapDataStore);
|
||||
|
||||
return {
|
||||
logOut,
|
||||
}
|
||||
return { logOut, temporaryData, tempFilterId, postRuleData, ruleData, allMapDataStore}
|
||||
},
|
||||
components: {
|
||||
DspLogo,
|
||||
IconMember
|
||||
},
|
||||
methods: {
|
||||
logOutButton() {
|
||||
if (this.$route.name === 'Map' && this.$route.params.type === 'log') {
|
||||
this.tempFilterId = null;
|
||||
this.temporaryData = [];
|
||||
this.postRuleData = [];
|
||||
this.ruleData = [];
|
||||
};
|
||||
this.logOut();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$route.name === 'Login' || this.$route.name === 'NotFound404' ? this.showMember = false : this.showMember = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user