프로젝트 수정을 위한 modelValue 추가

This commit is contained in:
yoon 2025-02-17 15:06:43 +09:00
parent eead7902c4
commit 26041d4b90

View File

@ -50,6 +50,10 @@
<script setup> <script setup>
import { ref, watch } from 'vue'; import { ref, watch } from 'vue';
const postcode = ref('');
const address = ref('');
const detailAddress = ref('');
const props = defineProps({ const props = defineProps({
title: { title: {
type: String, type: String,
@ -71,7 +75,7 @@ const props = defineProps({
default: 30, default: 30,
required: false, required: false,
}, },
isRow : { isRow: {
type: Boolean, type: Boolean,
default: false, default: false,
required: false, required: false,
@ -81,14 +85,23 @@ const props = defineProps({
default: false, default: false,
required: false, required: false,
}, },
modelValue: {
type: Object,
default: () => ({}),
required: false
}
}); });
const emits = defineEmits(['update:data', 'update:alert']); // watch
watch(() => props.modelValue, (newValue) => {
if (newValue) {
postcode.value = newValue.PROJCTZIP || '';
address.value = newValue.PROJCTARR || '';
detailAddress.value = newValue.PROJCTDTL || '';
}
}, { immediate: true });
// const emits = defineEmits(['update:data', 'update:alert']);
const postcode = ref('');
const address = ref('');
const detailAddress = ref('');
// //
const openAddressSearch = () => { const openAddressSearch = () => {