Answer the question
In order to leave comments, you need to log in
How to configure routing correctly (Express, vue)?
There is a table made in vue (based on the table from vue-bootstrap ), which can be sorted by anyone, there is pagination and search. In data something like
filter: null,
sortBy: null,
sortDesc: false,
selectedPosition: '',
selectedType: '',
selectedRarity: '',
selectedGroup: '',
?page=2&position=event&sortBy=name&sortDesc=true&search=abs
the table was immediately rendered with parameters. Quite perfect - if so -/page/2?position=event&sortBy=name&sortDesc=true&search=abs
. const router = new VueRouter({
mode: 'history',
routes: [
{ path: '/page/:id', components:table, props: true}
]
});
Answer the question
In order to leave comments, you need to log in
You can combine. You need this module https://www.npmjs.com/package/express-history-api-... to set up a fallback from /page/:id to index.html (through which vue works) with it.
The same can be done through a web server (nginx, apache), but since you already have express, do it through it. Read more here:
https://router.vuejs.org/en/essentials/history-mod...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question