Vue, how does the input box in the v-for loop give a non-empty prompt? click the next button. When the first behavior is empty, the raw material name cannot be empty, and when the second behavior is empty, the factory entry time cannot be empty.
HTML:
<ul>
<li v-for="(list,id) in lists" :key="id">
<label>{{list.title}}</label>
<input type="text" :type="list.type" v-model="ylMsg[list.id]" >
<i v-show = "id!=0" @click="lists.splice(id,1)" class="iconfont icon-delete del-font"></i>
</li>
</ul>
js:
export default {
data () {
return {
ylMsg: {"": "", "": "", "": "", "": ""},
lists: [
{id: "", title: ""},
{id: "", title: "", type: "date"},
{id: "", title: ""},
{id: "", title: ""}
],
}
}
}
how to judge this?