DEV Community

Discussion on: Quick Vue Tip: Cleaner Data Fetching

therealdanvega profile image
Dan Vega • Edited

Great tip Miguel. You can also use this to watch the route or route params if your avenger id was coming from the route (/avengers/3). You just need to put it in quotes like this:

watch: {
  '$': {
    immediate: true,
imtiyaz profile image
Mohammed Imtiyaz

Great Tip!!

Thanks for sharing it. Just like you read my mind.

mccabiles profile image
Miguel Author

Yes! Applying this to your Vue routes is the logical extension for this pattern, and is how I use it in my apps as well. Thank you for sharing, Dan!

julianalmandos profile image
Julian Luis Almandos

Thanks for sharing this Dan, sometimes var manipulation can be very tricky