mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-08-02 20:15:18 +02:00
feat: added components
This commit is contained in:
parent
6e0c369398
commit
5fa81533d9
30 changed files with 2405 additions and 1853 deletions
|
@ -1,20 +0,0 @@
|
|||
import {Component, Vue} from 'nuxt-property-decorator'
|
||||
|
||||
const copyToClipboard = (text: string) => {
|
||||
const input = document.createElement('textarea')
|
||||
input.innerHTML = text
|
||||
document.body.appendChild(input)
|
||||
input.select()
|
||||
const result = document.execCommand('copy')
|
||||
document.body.removeChild(input)
|
||||
return result
|
||||
}
|
||||
|
||||
@Component
|
||||
export class Copyable extends Vue {
|
||||
copy(text: string, toastText = 'Copied to clipboard !') {
|
||||
copyToClipboard(text)
|
||||
console.log(toastText)
|
||||
this.$toast.success(toastText)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue