Port to Vue3 and TypeScript

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2025-05-01 13:25:11 +02:00
parent b447417d0f
commit e572d2f545
No known key found for this signature in database
33 changed files with 2297 additions and 5930 deletions

View file

@ -8,10 +8,13 @@
<i :class="{'fas fa-fw fa-clipboard': !copyToClipboardSuccess, 'fas fa-fw fa-circle-check': copyToClipboardSuccess}" />
</button>
</template>
<script>
export default {
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
computed: {
hasClipboard() {
hasClipboard(): boolean {
return Boolean(navigator.clipboard && navigator.clipboard.writeText)
},
},
@ -23,7 +26,7 @@ export default {
},
methods: {
copy() {
copy(): void {
navigator.clipboard.writeText(this.content)
.then(() => {
this.copyToClipboardSuccess = true
@ -43,5 +46,5 @@ export default {
type: String,
},
},
}
})
</script>