mirror of
https://github.com/Luzifer/ots.git
synced 2025-08-13 16:35:37 -04:00
Port to Vue3 and TypeScript
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
b447417d0f
commit
e572d2f545
33 changed files with 2297 additions and 5930 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue