Vue.js Axios.post sends variables to php, but I cannot access those variables
I'm new to frontend development, and I'm facing a problem that I cannot resolve.
What I am trying to do is open a new popup HTML page with parameters (which I can pass as an array) by calling axios.post method from my vue.js file.
I googled possible solutions, but still could not find the source of the problem. Observing Chrome console, I suspect that axios.post works fine since it says:
data: "Array( [index_id] => 1 [log_id] => 63)…ow.print(); //
});", status: 200, statusText: "OK", headers:
{…}, config: {…}, …}
However, in the popup window, I cannot access the variables, or they are null.
The following code is a function in my vue.js:
And this is the very first part of popup_output_print.php
Then the popup window prints index_id is null
What am I doing wrong?
UPDATE: following the comment, I just tried var_dump, and the variables are all null.
:(
What is going on is that axios.post have totally no effect to window.open:
this makes a GET request with no params.
From my view, the better approach is to use something like Vue modal, i.e.:
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.