Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to call function from another component in vue js

Vue.component('component1', {
  methods: {
    c1method: function(){
     alert('this is c1method')
    },
  }
})
Vue.component('component2', {
  methods: {
    c2method: function(){
     component('component1').c1method()//like this
    },
  }
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #call #function #component #vue #js
ADD COMMENT
Topic
Name
8+4 =