Comments (6)
You can use this.$router.resolve({ name : 'your-route-name', params : { user_id : 10 } }).href
to get the url of the route. take a look at official docs here router.resolve
: http://router.vuejs.org/en/api/router-instance.html
from vue-toasted.
I know that but using
<a href="/users/10">Milad</a>
causes page refresh.
from vue-toasted.
Oh yes !! that will be a problem. the toast doesnt use the vue template engine it just uses plain javascript to build the html content. ill take a look if that is possible to make the component work.
although on your case you can attach an event listener to the <a>
and use the vue-router
push method to navigate to the location.
let toast = this.$toasted
.show('<p>User <a href="">Milad</a> Successfully Created !!</p>');
toast.el
.getElementsByTagName('a')[0]
.addEventListener('click', (e) => {
e.preventDefault();
// in here redirect the user via $router
})
hope that helps. PR's are always welcome
from vue-toasted.
Do you think using "slot" is an option?
from vue-toasted.
Yeah it can be option if it is built via the vue template engine. but the toast is generated by plain javascript. thats the problem.
from vue-toasted.
and also please take a look at globalToasts
feature. if the problem is reusing the toast again and again with that large code. this might help to resolve it.
https://github.com/shakee93/vue-toasted#reusable-global-toasts
from vue-toasted.
Related Issues (20)
- Using another icon pack
- Event Listeners are never removed
- How to prevent multiple Toast overlaps?
- Keyboard navigation not working HOT 1
- grouping toasts in predefined areas
- ClassName are keep on each show
- Custom image ?
- How can I change the font for the component? HOT 1
- Unable to use Material Icons variants
- TypeError: Cannot read property 'style' of null
- Edit styling of default this.$toast.success('message') ? HOT 1
- [Feature] 🎨 Action buttons cannot be set dynamically when using custom registration
- Aria Role should be configurable
- Add example where icon can be added by function HOT 1
- Type for keepOnHover is missing
- Clear all toasts without animations
- Toasts do not work when used alongside vue-turbolinks after first page change HOT 1
- does show method accept custom component?
- Not working with VUEX HOT 1
- How use with Nuxt 3? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-toasted.