refactor(types): copy can handle numbers

This commit is contained in:
Corentin Thomasset 2021-06-11 22:27:38 +02:00
parent 0afac97616
commit 35490851fe
No known key found for this signature in database
GPG key ID: DBD997E935996158
2 changed files with 3 additions and 4 deletions

View file

@ -12,9 +12,8 @@ const copyToClipboard = (text: string) => {
@Component @Component
export class CopyableMixin extends Vue { export class CopyableMixin extends Vue {
copy(text: string, toastText = 'Copied to clipboard !') { copy(text: string|number, toastText = 'Copied to clipboard !') {
copyToClipboard(text) copyToClipboard(String(text))
console.log(toastText)
this.$toast.success(toastText) this.$toast.success(toastText)
} }
} }

View file

@ -11,7 +11,7 @@
<v-btn depressed class="mr-4" @click="refreshPort"> <v-btn depressed class="mr-4" @click="refreshPort">
Refresh Refresh
</v-btn> </v-btn>
<v-btn depressed @click="copy(port.toString())"> <v-btn depressed @click="copy(port)">
Copy port Copy port
</v-btn> </v-btn>
</div> </div>