Banner.vue 505 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <div class="col-xs-offset-2 col-xs-8">
  3. <div class="page-header">
  4. <h2>Vue Router Demo</h2>
  5. <button @click="back">后退</button>
  6. <button @click="forward">前进</button>
  7. <button @click="test">测试一下go</button>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. name:'Banner',
  14. methods: {
  15. back(){
  16. this.$router.back()
  17. // console.log(this.$router)
  18. },
  19. forward(){
  20. this.$router.forward()
  21. },
  22. test(){
  23. this.$router.go(3)
  24. }
  25. },
  26. }
  27. </script>