Home > Back-end >  A method call another method in vue
A method call another method in vue

Time:11-21

Today when writing the vue encountered a problem, I would like to export to execute the query again, before this query involves recursive operations, but the method of execution order is very strange, query execution only a layer is performed behind the content of the export, this is the source code, can you tell me how to make query recursive bosses walk the execute that code again?
 

ExportExcel (path) {
Enclosing findPage (path);//to execute the query (recursive)
Var data=https://bbs.csdn.net/topics/this.dataList;//the target data
Window. The location. Href='https://bbs.csdn.net/api/report? Data='+ data;
}

CodePudding user response:

Write the code is divided into two methods of you here, and then call

CodePudding user response:

Carefully check the findPage

CodePudding user response:

reference shpery reply: 3/f
carefully check findPage


Is a recursive call

CodePudding user response:

reference 1st floor KeepSayingNo response:
write you here the code is divided into two methods, and then call it


Already written the export single method, but the execution order is unchanged

CodePudding user response:

FindPage logic inside there is a problem

CodePudding user response:

The
refer to 6th floor Jason Williams (????????????? ?). Response:
findPage alright with logic inside
I perform findPage alone is no problem, will directly to the recursive process

CodePudding user response:

SetTimeout (function () {
The grid. API. ReloadData ();
}, 500);
To perform this. FindPage (path);//to execute the query (recursion), make the back of the function method for one to try

CodePudding user response:

Var data=https://bbs.csdn.net/topics/this.dataList;//the target data
Window. The location. Href='https://bbs.csdn.net/api/report? Data='+ data;
Put this directly to you the data after traversal method below, write a method directly

CodePudding user response:

Should probably because you the method above is the query to the background data, because he is query time background, the front desk is considered to be executed, the actual background data returned is not complete, I usually write this method successfully in return when the methods of

CodePudding user response:

The
references to the eighth floor Jason Williams (????????????? ?). Response:
setTimeout (function () {
The grid. API. ReloadData ();
}, 500);
To perform this. FindPage (path);//to execute the query (recursion), make the back of the function method for a try try

Settled, thank you for your bosses

CodePudding user response:

11 references weixin_44536089 response:
Quote: refer to the eighth floor Jason Williams (????????????? ?). Response:
setTimeout (function () {
The grid. API. ReloadData ();
}, 500);
To perform this. FindPage (path);//to execute the query (recursion), make the back of the function method for a try try

Solved, thank you for your bosses

Solve the line
  • Related