0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Vue.JSのカスタムdirectiveをIntelliJ(WebStorm)で補完が効くように

Posted at

概要

Vue.JS のカスタム directive をプラグインとして IntelliJ で開発していると、補完が効かないし、利用部分で警告がでますよね。
これを解決する方法です。

下記のように警告がでる:
image.png

解決方法

1. package.json

package.json に下記追加

  "web-types": "./web-types.json"

2. web-types.json

package.json と同じ階層に web-types.json 追加。

web-types.json
{
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/v2-preview/web-types.json",
  "name": "プロジェクト名",
  "framework": "vue",
  "version": "1.0.0",
  "contributions": {
    "html": {
      "vue-directives": [
        {
          "name": "hoge"
        }
      ]
    }
  }
}
  • "name": "hoge" のところで v-hoge というカスタム directive を登録しています。

これだけ!

参考

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?