Converted components/settings/Themes.vue to composition api
This commit is contained in:
parent
bb6470edb7
commit
3581e1dd23
@ -1,18 +1,25 @@
|
||||
<template>
|
||||
<select v-on:change="change" :value="theme">
|
||||
<option value="">{{ $t("settings.themes.light") }}</option>
|
||||
<option value="dark">{{ $t("settings.themes.dark") }}</option>
|
||||
<option value="">{{ t("settings.themes.light") }}</option>
|
||||
<option value="dark">{{ t("settings.themes.dark") }}</option>
|
||||
</select>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "themes",
|
||||
props: ["theme"],
|
||||
methods: {
|
||||
change(event) {
|
||||
this.$emit("update:theme", event.target.value);
|
||||
},
|
||||
},
|
||||
<script setup lang="ts">
|
||||
import { SelectHTMLAttributes } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
defineProps<{
|
||||
theme: any;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "update:theme", val: string | null): void;
|
||||
}>();
|
||||
|
||||
const change = (event: Event) => {
|
||||
emit("update:theme", (event.target as SelectHTMLAttributes)?.value);
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user