1、概述

Angular6引入jQuery变得异常简单,请参考https://blog.csdn.net/qq_35321405/article/details/80270496

同样,Angular想使用jQuery-knob和jQuery一样的操作。

2、简单流程

  • yarn add jquery 或者 npm install jquery --save(后面省略或的内容)
  • yarn add @types/jquery
  • yarn add jquery-knob
  • yarn add @types/jquery-knob
// componnet的头部引入
import * as $ from 'jquery';
import 'jquery-knob';

// componnet中使用
ngOnInit(): void {
    $(function() {
      $(".dial").knob();
    });
}

// html中
<input type="text" value="75" class="dial">

代码参考:https://github.com/a1164714/jquery-knob-demo

相关文章:

  • 2021-12-23
  • 2022-03-02
  • 2022-01-15
  • 2021-06-28
  • 2021-07-02
  • 2022-12-23
  • 2021-09-04
  • 2022-01-02
猜你喜欢
  • 2021-10-17
  • 2021-09-12
  • 2022-03-05
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-05-07
相关资源
相似解决方案