I am doing a project in Vue with Vue-Router . in my project ,i have a param named 'adtag' , which must be in the url query params , is there any simple way to hold this param ,no mater how router goes.
for example , I have three pages:
- localhost/index
- localhost/list
- localhost/detail?id=11
page change using vue-router <router-link :to="{name:'Detail',query:{id:item.id}}"></router-link>
if I opened first page localhost/index?adtag=123
with adtag,page will changes with param 'adtag'
- localhost/index?adtag=123
- localhost/list?adtag=123
- localhost/detail?adtag=123&id=11
router.beforeEach
navigation guard, doc: router.vuejs.org/en/advanced/navigation-guards.html – nicolast