♻️ (production flow) use of defineModel

This commit is contained in:
Julien Calixte
2023-05-29 11:04:16 +02:00
parent d8dbce2fd7
commit 95cdd26c2b
2 changed files with 4 additions and 11 deletions

View File

@@ -2,22 +2,15 @@
defineProps<{ defineProps<{
id: string id: string
label: string label: string
modelValue: string
}>()
defineEmits<{
(event: "update:modelValue", value: string): void
}>() }>()
const modelValue = defineModel<string>()
</script> </script>
<template> <template>
<div class="form-input"> <div class="form-input">
<label :for="id">{{ label }}</label> <label :for="id">{{ label }}</label>
<input <input type="text" id="id" v-model="modelValue" />
type="text"
id="id"
:value="modelValue"
@input="$emit('update:modelValue', $event.target?.value ?? '')"
/>
</div> </div>
</template> </template>

View File

@@ -8,7 +8,7 @@ const newTeam = ref("")
const addTeam = () => { const addTeam = () => {
store.addTeam({ store.addTeam({
name: "User Acceptance Testing", name: newTeam.value,
outputs: ["Go for live"], outputs: ["Go for live"],
prerequisites: ["new app version is step in staging environment"], prerequisites: ["new app version is step in staging environment"],
intention: intention: