function callback() {
console.log('This is callback');
}
const vueModal = new Vue({
render: (h) => h(App, { attrs: { callback } }),
});
vueModal.$mount('#app');
export default {
props: {
callback: Function,
},
created() {
this.callback();
}
}
<input :value="curr" @input="($event) => $emit('currUpd', $event.target.value)">
<template>
<div>
<input @input="pass($event, 'currUpd')">
</div>
</template>
<script>
export default {
methods: {
pass(e, name) {
this.$emit(name, e.target.value);
}
}
};
</script>