fix: required

This commit is contained in:
三咲智子 Kevin Deng 2023-08-01 17:42:37 +08:00
parent 9bc5c1c648
commit 30f2484efa
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
5 changed files with 7 additions and 5 deletions

View file

@ -8,7 +8,7 @@ const { options, command } = defineProps<{
command?: boolean command?: boolean
}>() }>()
const modelValue = defineModel<string>() const modelValue = defineModel<string>({ required: true })
const tabs = $computed(() => { const tabs = $computed(() => {
return options.map((option) => { return options.map((option) => {

View file

@ -3,7 +3,7 @@ defineProps<{
title?: string title?: string
message: string message: string
}>() }>()
const modelValue = defineModel<boolean>() const modelValue = defineModel<boolean>({ required: true })
</script> </script>
<template> <template>

View file

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import Fuse from 'fuse.js' import Fuse from 'fuse.js'
const modelValue = defineModel<string>() const modelValue = defineModel<string>({ required: true })
const { t } = useI18n() const { t } = useI18n()
const userSettings = useUserSettings() const userSettings = useUserSettings()

View file

@ -3,7 +3,9 @@ const { editing } = defineProps<{
editing?: boolean editing?: boolean
}>() }>()
const modelValue = defineModel<string>() const modelValue = defineModel<string>({
required: true,
})
const currentVisibility = $computed(() => const currentVisibility = $computed(() =>
statusVisibilities.find(v => v.value === modelValue.value) || statusVisibilities[0], statusVisibilities.find(v => v.value === modelValue.value) || statusVisibilities[0],

View file

@ -40,7 +40,7 @@ export default defineNuxtConfig({
macros: { macros: {
setupSFC: true, setupSFC: true,
betterDefine: false, betterDefine: false,
// defineModels: false, defineModels: false,
}, },
devtools: { devtools: {
enabled: true, enabled: true,