Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to call function from parent component in child component vue

 this.$parent.someMethod();
Comment

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 },
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript includes check object 
Javascript :: pdf to html js 
Javascript :: js remove specific item from array 
Javascript :: regular expression in elastic 
Javascript :: GET http://localhost:8000/js/app.js net::ERR_ABORTED 404 (Not Found) in laravel 6 
Javascript :: every break js 
Javascript :: &ldquo;javascript remove last element from array 
Javascript :: how to get table last row id in jquery 
Javascript :: console log error javascript 
Javascript :: js while continue 
Javascript :: react-select 
Javascript :: password validation with regular expression in javascript 
Javascript :: javascript date double digit month 
Javascript :: Get size of a View in React Native 
Javascript :: javascript interview questions for freshers 
Javascript :: nodejs http get request to external server 
Javascript :: Regex Chords 
Javascript :: event loop in javascript 
Javascript :: append to map javascript 
Javascript :: is undefined false in javascript 
Javascript :: random color 
Javascript :: javascript non-repeating randomize array 
Javascript :: convert json object to lowercase 
Javascript :: nodejs exit code 
Javascript :: how to make a timer in javascript 
Javascript :: react native webview postmessage example 
Javascript :: accept only video in input type file below size 
Javascript :: json api 
Javascript :: how to enable emit on react in vs code 
Javascript :: jquery find input type password 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =