Difference between revisions of "User.vue"

From rbachwiki
Jump to navigation Jump to search
(Created page with "<pre> <template> <div id="app"> <h1>User Page</h1> <button @click="navigateToHome" class="mybutton"> Go to Home</button> <hr> <router-view></router-view> </div> <...")
 
 
Line 24: Line 24:


<style>
<style>
.mybutton{
.mybutton{
   padding: 10px;
   padding: 10px;
Line 34: Line 35:


</pre>
</pre>
[[VueJs Routing]]

Latest revision as of 23:27, 17 October 2018

<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