Can I call mixin function from asyncData()
method of the page component with Nuxt.js?
My code:
<template>
...
</template>
<script>
import api from "@/plugins/api/api.js"
...
export default {
...
async asyncData(context) {
...
context.apiMethodName()
...
}
...
}
...
</script>
api.js
import Vue from 'vue'
import API from '@/assets/js/api'
Vue.mixin({
methods: {
apiMethodName() { ... }
}
})