My code in routes.js is:
{
path: '/order/:order_id',
xhrCache: false,
on: {
pageBeforeIn: function (event, page) {
app.progressbar.show('multi');
},
pageAfterIn: function (event, page) {
app.progressbar.hide();
},
pageMounted: function (event, page) {
},
},
async: function ({ app, to, resolve }) {
console.log(app.props.order_id);
fetch('http://localhost/app/pages/order_info.html?order_id={{order_id}}')
.then((res) => res.text())
.then(function (data) {
resolve(
{
component: app.component.parse(data),
}
)
})
.catch (function (error) {
resolve(
{
content: errorLoader,
},
)
})
},
},
I need pass “order_id” in url of the fetch function, like this:
fetch('http://localhost/app/pages/order_info.html?order_id=**123**')
But order_id is not being passed to the fetch URL.
I’m stuck with this and haven’t found any way to resolve it.
Someone can help me?