User.vue

From rbachwiki
Jump to navigation Jump to search
<template>
  <div id="app">
  <h1>User Page</h1>

  <button @click="navigateToHome" class="mybutton"> Go to Home</button>
  <hr>
  <router-view></router-view>
  </div>
</template>

<script>
export default {

  methods: {
    navigateToHome(){
      // adds the link to the stack so you can hit the back button
      this.$router.push('/')

    }
  }
}
</script>

<style>

.mybutton{
  padding: 10px;
  background-color:azure;
  color:brown;
}


</style>

VueJs Routing