To implement A function: jump from page A to page B, and page A’s parameters are passed to page B, which uses the passed parameters.



From A to B.

In fact, there are two steps: 1, A passes the parameter. 2, B accepts parameters.

I. Page jump and transfer parameters

On the corresponding button of page A, write A method, which will be called when clicked to jump.

# content of A <el-button size="mini" icon="el-icon-zoom-in" @click.native="goto_report_log(scope.row.job_name)"  </el-button> ... . # write the corresponding method goto_report_log (job_name) {/ / this. Click to jump to report page $router. Push ({path: '/ manage/testReportAndLogo, query: { job_name: job_name } } ) }Copy the code

At this point, click the button to switch to page B.

2. Receiving parameters

First, the corresponding HTML field of page B should be added properly. This is the premise.

<el-form-item label="Job name" labelWidth="110px"> < EL-input placeholder=" input Job name" V-model ="this.job_name" </el-input> </el-form-item> ... . Export default {data() {return {job_name: "", # . Methods: {getParams() {this.job_name = this.$route.query. . created() { this.getParams(); # create ();Copy the code

It’s simple. Make a note.