<template> <div> <div @click="toLb"> export default {data() {return { Name :'hello, how are you '}; }, methods: { toLb() {Copy the code

Mounted (){this.name=this.$route.query. ParamB} {this.name=this.$route.query.

      this.$router.push({
        path: "/Lb",
        query: {
          paramB: this.name
        },
Copy the code

Note: The paramB parameter passed through the params object of the route is always undefined. That is because the params object of the route must call the route by the route name, rather than by the path. The query object does not require this.

        params: {
          paramA: "a"
        }
      });
Copy the code

String jump

      this.$router.push('/Lb')
Copy the code

Named route jump

      this.$router.push({name:'Lb'})
    }
  }
};
</script>
Copy the code

This is the Lb component that receives the value from the previous page

  export default {
  data() {
    return {
      name:''
    };
  },
  components: {
    Header
  },
  mounted(){
    this.name=this.$route.query.paramB
  }
};
Copy the code