Harold-Hua
<template>
  <a @click="goNext">Next</a>
  <input type="text" v-model="year"/>
  <input type="text" v-model="day"/>
</template>

<script>
  export default {
    data() {
      rerurn {year: \'\', day: \'\'}
    },
    methods: {
      goNext() {
        this.$router.push({name: \'test\', params: {year: this.year, day: this.day}})
      }
    }
  }
</script>

A页面传递

 

<template>
  <div>{{this.$route.params.year}}{{this.$route.params.day}}</div>
</template>

B页面接收

 

{
  path: \'/test\',
  name: \'test\',
  component: Test
}

修改router的index.js

 

 

如果还看不明白,参考:https://www.cnblogs.com/WQLong/p/7804215.html、https://blog.csdn.net/qq_15646957/article/details/78070862

反正我是看了这才明白的。

分类:

技术点:

相关文章:

  • 2021-11-28
  • 2021-11-28
  • 2021-06-05
  • 2021-11-28
  • 2021-10-10
猜你喜欢
  • 2021-11-28
  • 2021-11-28
  • 2021-11-28
  • 2021-11-28
  • 2021-11-28
  • 2021-05-11
相关资源
相似解决方案