From b08f3b4a802ae0e83284c21724244a74bad13a52 Mon Sep 17 00:00:00 2001 From: james south Date: Thu, 17 May 2018 03:08:57 -0500 Subject: [PATCH] Update README * Update README fix typos, add $copyText example from sample2, close #28 --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7b3a21b..bc8c316 100644 --- a/README.md +++ b/README.md @@ -63,20 +63,63 @@ new Vue({ ## I want to copy texts without a specific button! -Yes, you can do it by using our new method: `this.$copyText`. see [sample2](sample2.html). +Yes, you can do it by using our new method: `this.$copyText`. See [sample2](sample2.html), where we replace the clipboard directives with a v-on directive. -Modern browser have some limiation like that you can't use `window.open` without a user iteraction. -So there's a same restriction on copy things! Test it before you use it. Make sure you are not +## Sample 2 + +```html +
+ + + + + +``` + +You can use [your Vue instance ```vm.$el```](https://vuejs.org/v2/api/#vm-el) to get DOM elements via the usual traversal methods, e.g.: + +```this.$el.children[1].children[2].textContent``` + +This will allow you to access the *rendered* content of your components, rather than the components themselves. + +Modern browsers have some limitations like that you can't use `window.open` without a user interaction. +So there's the same restriction on copying things! Test it before you use it. Make sure you are not using this method inside any async method. -Before using this feature, reading +Before using this feature, read: [this issue](https://github.com/zenorocha/clipboard.js/issues/218) and [this page](https://github.com/zenorocha/clipboard.js/wiki/Known-Limitations) first. ### Contribution -PRs welcome, and issues aswell! If you want any feature that we don't have currently, -please fire a issue for feature request. +PRs welcome, and issues as well! If you want any feature that we don't have currently, +please fire an issue for a feature request. ### License