亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

React中jquery引用的實(shí)現(xiàn)方法

 更新時(shí)間:2017年09月12日 14:09:55   作者:add+  
這篇文章主要介紹了React中jquery引用的實(shí)現(xiàn)方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

在React中引用Jquery比較好玩,獲取元素的數(shù)據(jù)更多

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(

      <div>

        <Button onClick={this.selectElement}>點(diǎn)擊一下</Button>

        <h4 className="text">這是:12</h4>

      </div>

    );

  }

  selectElement() {

    console.log('text對(duì)象:',$('.text'));

    console.log('text中的值:',$('.text')[0].textContent);

  }

}

export default testJquery;

2.界面樣式

3. 控制臺(tái)打印結(jié)果

 4.text對(duì)象部分屬性

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論