React复制组件的使用

2019-11-17 张宇童 学习日志

import React, {
  Component
} from 'react';
import copy from 'copy-to-clipboard';

class App extends Component {

  handleClick = (e) => {
    copy(e.target.value)
  }

  render() {
    return (
      <div className="App">
        <p>
          <input placeholder='请输入' onClick={this.handleClick}/>          
        </p>
        <textarea></textarea>
      </div>
    );
  }
}

标签: javascript ES6

发表评论:

Powered by emlog