1
I’m testing Mixins on Vuejs and I have a question.
It’s like I call an event directly from a Mixins without having to assign in mine methods
?
Mymixins.js
import Vue from 'vue'
Vue.mixin({
methods: {
Alerta(){
alert('WORK!')
}
}
})
app.
<template>
<button v-on:click="AlertaInterno">test</button>
</template>
<script>
export default{
methods:{
AlertaInterno(){
this.Alerta()
}
}
}
</script>
The above code works. I wondered how I could invoke mixin function directly, something like this:
app.
<template>
<button v-on:click="this.Alerta()">test</button>
</template>
Thank you!
Perfect!! Thank you!!!
– Jackson