I'm testing Mixins on VueJS and I have a question.
How can I call an event directly from a Mixins without having to assign it to my methods
?
MyMixins.js
import Vue from 'vue'
Vue.mixin({
methods: {
Alerta(){
alert('WORK!')
}
}
})
app.vue
<template>
<button v-on:click="AlertaInterno">test</button>
</template>
<script>
export default{
methods:{
AlertaInterno(){
this.Alerta()
}
}
}
</script>
The above code works. I wanted to know how I could invoke the mixin function directly, something like this:
app.vue
<template>
<button v-on:click="this.Alerta()">test</button>
</template>
Thank you!