当前位置:   article > 正文

解决 Cannot find name ‘$‘_cannot find name '$'. do you need to install type

cannot find name '$'. do you need to install type definitions for jquery? tr
ERROR in src/app/coms/simple-icon-tips-tag/simple-icon-tips-tag.component.ts(17,5): error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.

直接运行

npm i @types/jquery

或者在 组件头部定义:

  1. import { Component, Input, OnInit } from '@angular/core';
  2. declare let $: any;

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/360074
推荐阅读
相关标签
  

闽ICP备14008679号