https://run.iviewui.com/Kkuaz9G0
see for yourself.
data-> cancel-> data
result, the select will not be verified.
<template>
<div>
<Form ref="valids" :model="device" :rules="ruless" :label-width="120">
<FormItem label="" prop="name">
<Input v-model="device.name" placeholder=""></Input>
</FormItem>
<FormItem label=" " prop="type.id">
<Select v-model="device.type.id" placeholder="" :transfer="true">
<Option v-for="(item,index) in datas" :value="item.id" :key=""type"+index">{{item.name}}</Option>
</Select>
</FormItem>
</Form>
<button type="info" @click="bb">
</button>
<button type="info" @click="bbc">
cancel
</button>
</div>
</template>
<script>
export default {
data () {
return {
device:{
type: {
id: null
}
},
datas: [{
id:65,
name: "type1"
},{
id:66,
name: "type2"
}],
ruless: {
name: [{ required: true, message: "", trigger: "blur" }, { required: true, message: "", trigger: "change" }],
"type.id": [{ required: true, message: "", trigger: "blur", type: "number" }, { required: true,
message: "",
trigger: "change",
type: "number" }]
},
}
},
methods: {
bb () {
this.device = {
id:4,
name: "test1",
type: {
name: "type1",
id:65
}
}
},
bbc () {
this.device = {
type: {
id:null
}
}
},
},
mounted () {
}
}
</script>
<style>
</style>