NuxtN
Nuxt4mo ago
4 replies
Cheaterman

Importing type from other component

I thought I could be able to import types using the
#components
alias but it doesn't seem to work for me.

Currently I'm importing types from other components using this:
import type { SelectableMission } from '@/components/JobTracking.vue'


Is that correct? I thought I should be able to use
import type { SelectableMission } from '#components/JobTracking.vue'

but it doesn't seem to work here, although I do have
  "extends": "./.nuxt/tsconfig.json",

in my
tsconfig.json
and
      "#components": [
        "./components"
      ]

is listed in
  "compilerOptions": {
    "paths": {
from
.nuxt/tsconfig.json
Was this page helpful?