我试图使用 v-bind 将数据传递给子组件,用于我的 vue 公式表单输入。我在父母中传递了这样的数据。
<ChildForm v-bind:formData="formData" ></ChildForm>
export default {
name: "Parent",
data() {
return {
formData: {
Full_Name: "",
Notes: "",
Address: "",
Phone: "",
City: "",
State: "",
Zip: "",
},
}}}
在 Child 中,我正在这样做
<FormulateForm v-model="formData">
<FormulateInput
type="textarea"
name="Notes"
label="NOTES"
validation="required|max:200,length"
validation-name="Notes"
:help="`Keep it under 200 characters. ${200 - this.formData.Notes.length} left.`"
/>
<FormulateInput
type="submit"
label="Submit Details"
/>
</FormulateForm>
export default {
name: "ChildForm",
props: {
formData: Object,
},
}
但我收到以下错误
Error in render: "TypeError: Cannot read property 'length' of undefined"
知道可能是什么问题吗?