Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nuxt js emit event

$nuxt.$emit('my-custom-event') // to emit an event

created() { listen to an event anywhere in the nuxt app
   this.$nuxt.$on('my-custom-event', () => {
     //Do Something
   })
}
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #nuxt #js #emit #event
ADD COMMENT
Topic
Name
8+8 =