How to pass dynamic params to Vue router
See original GitHub issueI need to be able to pass params along to Vue router when clicking a Toasted action button. I can’t seem to find any documentation on how to accomplish this. Here’s what I have:
Vue.toasted.register( "showSpecialAlert", payload => { // message if (!payload.holdName) { return "No hold selected"; } return "Generating activity for " + payload.holdName; }, { // options position: "top-center", keepOnHover: true, duration: 5000, action: { text: "View", push: { name: "showHold", // THIS DOESN'T WORK holdId: payload.holdId // NEITHER DOES THIS params: { holdId: payload.holdId } // NO ERROR IN CODE, BUT NOT DYNAMIC AND DOESN'T SHOW UP IN VUE DEV TOOLS params: { holdId: 2 } //// } } } );
Edit: code looks bad here; Replit link: https://repl.it/@BoClifton/Pass-Vue-Router-route-in-global-Toasted
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
same issue, options could maybe be a function like message? we recive payload, extend it and return it back.
@MrTheSoulz Hey for this scenario you will need to use the normal toast warapped inside a function.