1
0

fix: use props destructuring everywhere

This commit is contained in:
kolaente
2023-06-20 14:39:59 +02:00
parent 78a268ab07
commit 3aa502e07d
17 changed files with 197 additions and 215 deletions

View File

@ -35,7 +35,7 @@
</template>
<script setup lang="ts">
import {computed, ref, toRef, watch} from 'vue'
import {computed, ref, watch} from 'vue'
import {createRandomID} from '@/helpers/randomId'
import XButton from '@/components/input/button.vue'
@ -53,22 +53,16 @@ const lastChangeTimeout = ref<ReturnType<typeof setTimeout> | null>(null)
const defaultColors = ref(DEFAULT_COLORS)
const colorListID = ref(createRandomID())
const props = defineProps({
modelValue: {
type: String,
required: true,
},
menuPosition: {
type: String,
default: 'top',
},
})
const {
modelValue,
} = defineProps<{
modelValue: string,
}>()
const emit = defineEmits(['update:modelValue'])
const modelValue = toRef(props, 'modelValue')
watch(
modelValue,
() => modelValue,
(newValue) => {
color.value = newValue
},