diff --git a/README.md b/README.md index 34b6396..ef35f0a 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ |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 @@ -25,7 +25,7 @@ Programmatically select the text of a HTML element. ## Example -### install +### Install ```bash npm install rsuite-clipboard --save ``` diff --git a/example/container/App.js b/example/container/App.js index fa62eea..32f22cd 100644 --- a/example/container/App.js +++ b/example/container/App.js @@ -15,7 +15,10 @@ class App extends Component { @@ -24,6 +27,17 @@ class App extends Component {

{''}


+

+ + bitHound Overall Score + + {' '} + + npm version + +

Modern copy to clipboard for react.

{this.props.children}
diff --git a/example/container/Home.js b/example/container/Home.js index ef953fd..8c013b6 100644 --- a/example/container/Home.js +++ b/example/container/Home.js @@ -8,6 +8,11 @@ class Home extends Component { return (

Example

+
+
+ {require('../md/basic_pre.md')} +
+
{require('../md/basic.md')} diff --git a/example/md/basic_pre.md b/example/md/basic_pre.md new file mode 100644 index 0000000..a49b5ed --- /dev/null +++ b/example/md/basic_pre.md @@ -0,0 +1,6 @@ +#### Install +```bash +npm install rsuite-clipboard --save +``` + +#### Usage