A
A
Andrey Suha2019-09-06 11:17:39
JavaScript
Andrey Suha, 2019-09-06 11:17:39

Is it possible to catch an event from a vue component in native js?

The vui case is embedded into the page as a separate component plus there is a file with native js is there a way to listen for example click in native js?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2019-09-06
@andreysuha

import Vue from 'vue';
import Component from './Component.vue';

const component = new Vue(Component).$mount('selector');
component.$on('event-name', () => console.log('wow'));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question