DEV Community

Mayank
Mayank

Posted on

Answer: Model URL parameter in VueJS

You can do it very elegantly and efficiently without using router. Use change or input event to update the hash.

new Vue({
  el: "#app",
  data: {
    agility: 25,
    hash: 0
  },
  methods: {
    addHash() {
      window.location.hash = this.agility;
      this.hash = this.agility;
    }
  },
  created: () => {
    const

Oldest comments (0)