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 :: react compress image 
Javascript :: using async function in useeffect 
Javascript :: send x-www-form-urlencoded request nodejs 
Javascript :: javascript class methods 
Javascript :: how to hide ascending descending icons in datatable js 
Javascript :: split array into chunks javascript 
Javascript :: array shift javascript 
Javascript :: dropify use 
Javascript :: mongodb replace root 
Javascript :: open modal useState 
Javascript :: mongoose delete 
Javascript :: check object is null empty or undefined 
Javascript :: check if an element is there in js 
Javascript :: hello world in html using javascript 
Javascript :: js increment and decrement function for cart 
Javascript :: angular automatic typewriter animation 
Javascript :: remove repetition 2d array javascript 
Javascript :: how to parse json in sql server 
Javascript :: send csrf token ajax laravel 
Javascript :: disable button js 
Javascript :: return a date time object in yyyy-mm-dd hr:min:sec 
Javascript :: console log return from async 
Javascript :: discord.js set playing tag 
Javascript :: Disabale Back History On Browsers JavaScript Jquery 
Javascript :: how to install jsonwebtoken in next js 
Javascript :: js get text from html string 
Javascript :: javascript fromEntries 
Javascript :: javascript arrow function 
Javascript :: jquery code to make click function 
Javascript :: convert utc to pst javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =