3
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?

More than 1 year has passed since last update.

Vue.jsでjQueryを使いたい

Posted at

はじめに

VueとTypeScriptを使用した案件で、jQueryの$.eachと$.inArrayを使いたかったため、Vueに、jQueryを導入しました。

npm インストール

npm install --save jquery @types/jquery

import

create.vue
import $ from "jquery";

最後に

以上を行う前は、機能としてはちゃんと動いていましたが、以下のエラーが出ていました。

Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.

npm インストールとimportを行いエラーが出なくなりました。

3
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
3
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?