我希望用 loginDialogForm 中的model字符串传给v-model,让他绑定字符串中的变量, 如何做到?
谢谢!!!
`
<el-form :model="loginDialogData" :ref="loginDialogData" label-width="80px" label-position="left">
<el-form-item
v-for="item in loginDialogFrom[loginDialogData.type]"
:key="item.label"
:label="item.label"
>
<el-input v-model="!###########!" :type=item.type ></el-input>
</el-form-item>
</el-form>
loginDialogData: {
type: 0,
email: '',
username: '',
password: ''
},
loginDialogFrom: [
[
{label: '邮箱', model: 'loginDialogData.email', type: 'email'},
{label: '密码', model: 'loginDialogData.password', type: 'password'}
],
[
{label: '邮箱', model: 'loginDialogData.email', type: 'email'},
{label: '昵称', model: 'loginDialogData.username', type: ''},
{label: '密码', model: 'loginDialogData.password', type: 'password'},
{label: '确认密码', model: '', type: 'password'}
]
]
`
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…