i'm dumb
This commit is contained in:
parent
29649cc4d7
commit
1250a2c2d0
|
@ -1,36 +1,13 @@
|
|||
Vue.component('copybox',{
|
||||
Vue.component('copbox',{
|
||||
template : `
|
||||
<div class="y2t-output">
|
||||
<div class="top">
|
||||
<span class="dumb-space"></span><span class="byl-icon-copy" v-on:click="copyToClipboard">Copy to clipboard</span>
|
||||
</div>
|
||||
<p>{{ txt }}</p>
|
||||
<div class="shader"></div>
|
||||
</div>
|
||||
`,
|
||||
props : {
|
||||
txt : String
|
||||
},
|
||||
methods : {
|
||||
copyToClipboard() {
|
||||
navigator.clipboard.writeText(this.txt).then(() => {
|
||||
console.log('Text copied to clipboard');
|
||||
}, (err) => {
|
||||
console.error('Failed to copy text: ', err);
|
||||
});
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
Vue.component('copbox',{
|
||||
template : `
|
||||
<div class="y2t-output">
|
||||
|
||||
<button v-on:click="copyToClipboard">Copy</button>
|
||||
|
||||
<div ref="textToCopy">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<div class="shader"></div>
|
||||
|
||||
</div>
|
||||
`,
|
||||
|
|
Loading…
Reference in New Issue