User.vue

From rbachwiki
Revision as of 23:27, 17 October 2018 by Bacchas (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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