Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What if i need to use Clipboard in bootstrap modal and in usuall place? #81

Open
moneyinvest opened this issue Feb 28, 2020 · 3 comments

Comments

@moneyinvest
Copy link

I cant make it working in both places using container option. What to do?

@moneyinvest moneyinvest changed the title What if i need to use Clipboard in bootstrap modal and and usuall place? What if i need to use Clipboard in bootstrap modal and in usuall place? Feb 28, 2020
@moneyinvest
Copy link
Author

I used in modal this code
this.$copyText(text, this.$refs.container), container is ref to our button copy.
it works

@Inndy
Copy link
Owner

Inndy commented Mar 12, 2020

Minimal reproduction sample please

@giuliano-macedo
Copy link

As stated by @moneyinvest you can solve this problem by using this.$copyText and passing the ref of a container that your element with v-clipboard is in.

Alternatively you can use VueClipboard.config.autoSetContainer = true in your main.js and the directive will work.

@Inndy Reproduction Sample with both solutions
https://codesandbox.io/s/bootstrap-modal-vue-clipboard2-cx05k?file=/src/App.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants