Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyangguo committed Jul 18, 2017
1 parent dd05cce commit b64e66a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -10,22 +10,22 @@
|children|`String`|--|CopyToClipboard is a simple wrapping component, it does not render any tags, so it requires the only child element to be present, which will be used to capture clicks.|
|onCopy|`function(text,result)`|--|Optional callback, will be called when text is copied|

## AutoComplete.copy
## Clipboard.copy
If you don't want to use `Clipboard`, you can execute this function to copy text in clipboard.
```
@param {String} text - Text to be copied to clipboard.
@return {Boolean} - Whether copy success.
```

## AutoComplete.select
## Clipboard.select
Programmatically select the text of a HTML element.
```
@param {HTMLElement} Element
```

## Example

### install
### Install
```bash
npm install rsuite-clipboard --save
```
Expand Down
16 changes: 15 additions & 1 deletion example/container/App.js
Expand Up @@ -15,7 +15,10 @@ class App extends Component {
</Navbar.Header>
<Navbar.Collapse>
<Nav pullRight>
<Nav.Item href="https://github.com/rsuite/rsuite-clipboard">GitHub</Nav.Item>
<Nav.Item href="https://github.com/rsuite/rsuite-clipboard">
<IconFont icon="github"/>
{' GitHub'}
</Nav.Item>
</Nav>
</Navbar.Collapse>
</div>
Expand All @@ -24,6 +27,17 @@ class App extends Component {
<div className="container">
<h1>{'<Clipboard/>'}</h1>
<hr/>
<p>
<a href="https://www.bithound.io/github/rsuite/rsuite-clipboard">
<img src="https://www.bithound.io/github/rsuite/rsuite-clipboard/badges/score.svg"
alt="bitHound Overall Score"
/>
</a>
{' '}
<a href="https://badge.fury.io/js/rsuite-clipboard">
<img src="https://badge.fury.io/js/rsuite-clipboard.svg" alt="npm version"/>
</a>
</p>
<p>Modern copy to clipboard for react.</p>
{this.props.children}
</div>
Expand Down
5 changes: 5 additions & 0 deletions example/container/Home.js
Expand Up @@ -8,6 +8,11 @@ class Home extends Component {
return (
<div>
<h2>Example</h2>
<div className="row">
<div className="col-md-8">
<Markdown>{require('../md/basic_pre.md')}</Markdown>
</div>
</div>
<div className="row">
<div className="col-md-8">
<Markdown>{require('../md/basic.md')}</Markdown>
Expand Down
6 changes: 6 additions & 0 deletions example/md/basic_pre.md
@@ -0,0 +1,6 @@
#### Install
```bash
npm install rsuite-clipboard --save
```

#### Usage

0 comments on commit b64e66a

Please sign in to comment.