|
@@ -8,7 +8,8 @@ type IFormData = {
|
|
|
"id": string|undefined,
|
|
"id": string|undefined,
|
|
|
"name": string,
|
|
"name": string,
|
|
|
"photoUrl": string,
|
|
"photoUrl": string,
|
|
|
- "feature": string
|
|
|
|
|
|
|
+ "feature": string,
|
|
|
|
|
+ "gender": number
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 定义组件的属性
|
|
// 定义组件的属性
|
|
@@ -53,7 +54,8 @@ const formData = ref<IFormData>({
|
|
|
photoUrl: '',
|
|
photoUrl: '',
|
|
|
name: '',
|
|
name: '',
|
|
|
feature: '',
|
|
feature: '',
|
|
|
- id: undefined
|
|
|
|
|
|
|
+ id: undefined,
|
|
|
|
|
+ gender: 1,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
@@ -65,6 +67,7 @@ watch(() => props.modelValue, (newModelValue) => {
|
|
|
...formData.value,
|
|
...formData.value,
|
|
|
...newModelValue
|
|
...newModelValue
|
|
|
};
|
|
};
|
|
|
|
|
+ console.log(formData.value,newModelValue,4444)
|
|
|
photos.value = newModelValue.photoUrl ? [newModelValue.photoUrl] : []
|
|
photos.value = newModelValue.photoUrl ? [newModelValue.photoUrl] : []
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -95,7 +98,8 @@ function resetForm() {
|
|
|
photoUrl: '',
|
|
photoUrl: '',
|
|
|
name: '',
|
|
name: '',
|
|
|
feature: '',
|
|
feature: '',
|
|
|
- id: undefined
|
|
|
|
|
|
|
+ id: undefined,
|
|
|
|
|
+ gender: 1,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -109,7 +113,8 @@ async function handleConfirm() {
|
|
|
id: '',
|
|
id: '',
|
|
|
name: '',
|
|
name: '',
|
|
|
photoUrl: '',
|
|
photoUrl: '',
|
|
|
- feature: ''
|
|
|
|
|
|
|
+ feature: '',
|
|
|
|
|
+ gender: 1,
|
|
|
}
|
|
}
|
|
|
const avatar = photos.value?.[0] ?? ''
|
|
const avatar = photos.value?.[0] ?? ''
|
|
|
// 字段全后再对齐字段
|
|
// 字段全后再对齐字段
|