当我在普通 html 标签上使用 vue 表单时<input>
,验证正在工作。当我<md-input>
改用验证不起作用时,我收到以下错误:
未找到具有 v-model 的元素
工作示例<input>
<vue-form :state="formState" @submit.prevent="onSubmit">
<validate>
<label>Name</label>
<input v-model="model.name" required name="name" />
<field-messages name="name">
<div>Success!</div>
<div slot="required">Name is a required field</div>
</field-messages>
</validate>
<button type="submit">Submit</button>
</vue-form>
不工作的例子<md-input>
<vue-form :state="formState" @submit.prevent="onSubmit">
<validate>
<md-input-container md-inline>
<label>Name</label>
<md-input v-model="model.name" required name="name"></md-input>
</md-input-container>
<field-messages name="name">
<div>Success!</div>
<div slot="required">Name is a required field</div>
</field-messages>
</validate>
<button type="submit">Submit</button>
</vue-form>