vue-clipboard2
vue-clipboard2 copied to clipboard
What if i need to use Clipboard in bootstrap modal and in usuall place?
I cant make it working in both places using container option. What to do?
I used in modal this code this.$copyText(text, this.$refs.container), container is ref to our button copy. it works
Minimal reproduction sample please
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