You've already forked AstralRinth
forked from didirus/AstralRinth
* refactor(frontend): move Toggle component to Composition API + TS **Toggle.vue**: - Enable composition API and TS - Added `disabled` to props - Remove redundant `checked` - Replace `modelValue` and `emits` with `defineModel` compiler macro **Others**: - Replace emit handling and `model-value` with `v-model` where simple logic was used - Not `FeatureFlagSettings.vue` (contained custom code on receiving emit) - Not `Mods.vue` (contained custom code on receiving emit) - Remove redundant `checked` attribute * fix(app): toggles not updating value
20 lines
316 B
Vue
20 lines
316 B
Vue
<template>
|
|
<input
|
|
type="checkbox"
|
|
class="switch stylized-toggle"
|
|
:id="id"
|
|
:disabled="disabled"
|
|
:checked="checked"
|
|
@change="checked = !checked"
|
|
/>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
defineProps<{
|
|
id?: string
|
|
disabled?: boolean
|
|
}>()
|
|
|
|
const checked = defineModel<boolean>()
|
|
</script>
|