What's the level of support for Vue 2? #740
-
I've tried this with a Vue 2 (Nuxt 2) project using the Options API. I have followed the readme to enable experimental Vue 2 support and noticed that it doesn't seem to be picking types that are declared in the For example the types for the The same affects the script tag. Is this expected with the current level of support or should I report it as an issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry for late to reply! vue-i18n already provided global properties types for vue2, to include it, you need to config {
"compilerOptions": {
// ...
"types": [..., "vue-i18n/types"]
},
// ...
} <template>{{ $t }}</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({ ... });
</script> or <template>{{ $t }}</template>
<script lang="ts">
import { defineComponent } from '@vue/composition-api';
export default defineComponent({ ... });
</script> |
Beta Was this translation helpful? Give feedback.
Sorry for late to reply! vue-i18n already provided global properties types for vue2, to include it, you need to config
"types": [..., "vue-i18n/types"]
tocompilerOptions
in tsconfig, and export the component byVue.extend
ordefineComponent
from@vue/composition-api
.or