0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VscodeでVuejs[@/]のalias補完

Last updated at Posted at 2025-02-24

設定方法

ディレクトリ構造

  • vscodeで開いているディレクトリ直下にjsconfig.jsonを作成
  • frontend配下でないことを注意
Projectroot
 L backend
    L hogehoge
 L frontend
    L src
 L jsconfig.json
 L tsconfig.json  //または

設定ファイル

jsconfig.json
{
  "compilerOptions": {
    "baseUrl": ".", // .をベースパスに設定
    "paths": {
      "@/*": [
        "frontend/src/*"
      ] // @/はfrontend/src/を指す
    }
  },
  "include": [
    "frontend/src/**/*"
  ] // srcフォルダ内の全ファイルを含める
}

settings.jsonも変更するらしい?

  • しなくても動く気が・・・
vscode/settings.json
{
    "typescript.preferences.importModuleSpecifier": "shortest",
    "javascript.preferences.importModuleSpecifier": "shortest",
    "eslint.validate": ["javascript", "javascriptreact", "vue"],
    "editor.formatOnSave": true,
}

補完が効かないと思ったら

  • vscodeさいきd
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?