[Vuejs]-Update form data based on a method in VueJS

0👍

I was able to solve the problem by changing the data structure a bit and adding a watcher to ‘label…

new Vue({
    el:'#app',
    data:{
        label:'',
    slug: ''
    },
    computed: {
    computedSlug () {
    return this.value.label+'Manish'
    }
    },
  watch: {
    label: function () {
        this.slug = this.sanitize(this.label)
    }
  },
  methods: {
   sanitize (label) {
    return label+'something'
   }
  }
});

Any other more sophesticated answers are most welcome 🙂

👤asanas

Leave a comment