Answers for "trigger a function inside child from parent vue"

0

trigger a function inside child from parent vue

import ChildForm from './components/ChildForm'

new Vue({
  el: '#app',
  data: {
    item: {}
  },
  template: `
  <div>
     <ChildForm :item="item" ref="form" />
     <button type="submit" @click.prevent="submit">Post</button>
  </div>
  `,
  methods: {
    submit() {
      this.$refs.form.submit()
    }
  },
  components: { ChildForm },
})
Posted by: Guest on December-05-2020

Code answers related to "trigger a function inside child from parent vue"

Code answers related to "Javascript"

Browse Popular Code Answers by Language