iview的Cascader的on-change需要傳入第三或者更多參入如何做?
阿新 • • 發佈:2018-11-21
@on-change="(value,selectedData)=>{setOption(value, selectedData,index)}"
增加Cascader on-change屬性 setOption為自定義的方法名,index為傳入的引數
下面是另一個例子
<div if="formItem.listenList != null"> <div v-for="listened in formItem.listenList" style="position: relative; left: 80px; margin-bottom: 5px; margin-top: 30px;"> <!-- <div v-bind:id="'listen_'+listened.id"> --> <!-- <i-select style="width:100px;" v-model="listened.eventTypeId" > <i-option v-for="parentType in eventParentType" :key = "parentType.id" :value = "parentType.id"> {{parentType.name}} </i-option> </i-select> --> <i-select v-model="listened.eventTypeId" :disabled="formItemDisabled" style="width:300px;"> <i-option v-for="event in eventParentType" :value="event.id" :key="event.id" placeholder="請選擇事件">{{event.nameCn}}-{{event.name}}</i-option> </i-select> <!-- <i-input style="margin-left:5px;width:350px;" :disabled="formItemDisabled" v-model="listened.name" :data="listenedName" @on-search="handleParentTypeSearch" placeholder="ddd"> </i-input> --> <!-- <AutoComplete style="margin-left:5px;width:350px;" :disabled="formItemDisabled" v-model="listened.name" :data="listenedName" :filter-method="" placeholder="sss"> </AutoComplete> --> <Cascader v-model="listened.listenName" :data="policyAndVariable" filterable style="width:350px;" placeholder="sss" clearable @on-change="(value,selectedData)=>{handleListenCascader(value,selectedData,listened)}"></Cascader> <i-button type="dashed" @click="removeListen(listened)"> <Icon type="minus-circled"></Icon></i-button> <!-- </div> --> </div>