Component mixin methods/members are not recognized by VSCode Intellisense
fullscreen.js

component.vue

Message shown wthen hovering 'makeFullscreen':

No error messages in Panel -> Output -> Vue Language Server
create and init a simple Vue project ("vue init webpack mixin-test")
create jsconfig.json file in the project root folder:
{
"compilerOptions": {
"alwaysStrict": true,
"checkJs": true,
"target": "es2016",
"module": "es2015",
"noImplicitAny": true,
"noImplicitReturns": true,
"baseUrl": "./",
"paths": {
"@/*" : ["*"],
"~/*" : ["*"]
}
},
"include": [
"**/*",
"**/*.vue"
]
}
/src/components:<template>
<div id="page">
<button @click="click"> Click me </button>
<div ref="fullscreen"> Content </div>
</div>
</template>
<script>
const fullscreen = {
methods: {
makeFullscreen(element) {
// ...
}
}
};
export default {
mixins: [fullscreen],
methods: {
click(e) {
this.makeFullscreen(this.$refs.fullscreen);
}
}
};
</script>
It's a known issue.
We cannot support mixin for now in TypeScript, which is the engine underhood.
If you use mixin a lot, you can consider using class style API provided in other libraries.