<script setup>
|
|
import IconKeyboard from "@/components/icons/IconKeyboard.vue"
|
import IconKeyboardStrikethrough from "@/components/icons/IconKeyboardStrikethrough.vue"
|
import {ref} from "vue"
|
|
const props = defineProps({
|
initial: {
|
type: Boolean,
|
default: false
|
},
|
})
|
const emit = defineEmits(["toggle"])
|
const strikethrough = ref(props.initial)
|
|
function toggle () {
|
strikethrough.value = !strikethrough.value
|
emit("toggle", strikethrough.value)
|
}
|
|
</script>
|
|
<template>
|
|
<button @click="toggle" type="button">
|
<IconKeyboard v-if="!strikethrough" />
|
<IconKeyboardStrikethrough v-if="strikethrough" />
|
</button>
|
|
</template>
|
|
<style scoped lang="stylus">
|
|
|
</style>
|