Try first view support
This commit is contained in:
57
dashboard/src/components/Index.vue
Normal file
57
dashboard/src/components/Index.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<div>
|
||||
<SupportView v-if="view === VIEWS.SUPPORT"></SupportView>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import SupportView from './SupportView.vue';
|
||||
|
||||
const VIEWS = {
|
||||
SUPPORT: 'support'
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
components: {
|
||||
SupportView
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
VIEWS,
|
||||
accessToken: localStorage.token,
|
||||
view: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
async mounted() {
|
||||
if (!localStorage.token) {
|
||||
console.error('Set localStorage.token');
|
||||
return;
|
||||
}
|
||||
|
||||
const that = this;
|
||||
function onHashChange() {
|
||||
const view = location.hash.slice(2);
|
||||
|
||||
if (view === VIEWS.SUPPORT) {
|
||||
that.view = VIEWS.SUPPORT;
|
||||
} else {
|
||||
that.view = '';
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('hashchange', onHashChange);
|
||||
onHashChange();
|
||||
|
||||
console.log('Indexvue mounted')
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user