Layui child parent page value transfer problem
-
Passing values from the parent page to the child page
Define a method getData1() in the child page, and the parameter data is to receive the value passed from the parent page. As shown in the figure:
call the getData1() method of the subpage in the success method of the parent page, and pass the parameters to the subpage. As shown in the figure:
In this way, the currentLocal of the parent page can be passed to the child page for use. Or you can splice the parameters after the url of the content. -
Passing values from child pages to parent pages
First, you can write a hidden field (such as a hidden input) on the child page and set the value to the hidden field. Then get the body content of the iframe page in the yes method of the parent page, and then get the value of the hidden field, so that the effect of passing the value from the child page to the parent page can be achieved. As shown in the picture: