您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

jquery引用React步奏详解

2024/3/11 15:37:41发布17次查看
这次给大家带来jquery引用react步奏详解,jquery引用react的注意事项有哪些,下面就是实战案例,一起来看一下。
在react中引用jquery比较好玩,获取元素的数据更多
引入方法举例:
import $ from 'jquery'; import { button } from 'antd'; class testjquery extends react.component {   constructor(props) {     super(props);     this.selectelement = this.selectelement.bind(this);   }   render() {     return(       <p>         <button onclick={this.selectelement}>点击一下</button>         <h4 classname="text">这是:12</h4>       </p>     );   }   selectelement() {     console.log('text对象:',$('.text'));     console.log('text中的值:',$('.text')[0].textcontent);   } } export default testjquery;
相信看了本文案例你已经掌握了方法,更多精彩请关注其它相关文章!
推荐阅读:
jquery判断是否浏览到网页底部
jquery使用iscorll实现手机端中上拉加载下拉刷新
以上就是jquery引用react步奏详解的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product