react native|React中jquery引用的实现方法

更新时间:2021-08-21    来源:jquery    手机版     字体:

【www.bbyears.com--jquery】

在React中引用Jquery比较好玩,获取元素的数据更多

1.引入方法举例:

import $ from "jquery";

import { Button } from "antd";

class testJquery extends React.Component {

  constructor(props) {
    super(props);

    this.selectElement = this.selectElement.bind(this);

  }

  render() {

    return(

      

        

        

这是:12

           );   }   selectElement() {     console.log("text对象:",$(".text"));     console.log("text中的值:",$(".text")[0].textContent);   } } export default testJquery;

2.界面样式

3. 控制台打印结果

 4.text对象部分属性

本文来源:http://www.bbyears.com/wangyezhizuo/137337.html