I have a mixin in my Vue project. But, it's not working. Here's the code:
InvMixin.js
export default {
created() {
console.log("hi");
},
methods: {
helloa() {
console.log('hi from mixin');
},
proal() {
console.log("hoye");
}
}
}
template
import invMixin from "./InventoryMixin.js";
export default {
mixins: [invMixin],
methods: {
check() {
this.helloa();
}
}
}
Output
helloa is referenced but not defined Created of mixin not working
Can someone help to solve it, please? Thankyou!!
InventoryMixinorinvMixin, try using only onemixins:[]inside of a prop which threw no errors.