Skip to content

Commit

Permalink
fix home button
Browse files Browse the repository at this point in the history
  • Loading branch information
Mefistosss committed Apr 9, 2022
1 parent 9d996ae commit ecf5f90
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
<template>
<button v-if="backButton" v-on:click="back" class="btn">Back</button>
<button v-if="homeButton" v-on:click="home" class="btn">Home</button>
<div class="window">
<router-view></router-view>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
name: 'App',
data() {
return {
currentPath: window.location.hash
};
},
computed: {
backButton() {
homeButton() {
return this.$route.name !== 'home';
}
},
mounted() {
// window.addEventListener('hashchange', () => {
// this.currentPath = window.location.hash;
// });
},
methods: {
back() {
// this.currentPath = '#/';
// window.location.hash = this.currentPath;
home() {
this.$router.push('/');
}
}
});
Expand Down

0 comments on commit ecf5f90

Please sign in to comment.