Additional mass participation record iview assembly problem

When using iview components, a problem often encountered additional parameter passing, under normal circumstances you can use the following two methods can be resolved:

1, after the direct input method parameters, sometimes borrow $eventto get the current information dom, in certain circumstances may be bound to parameter dataset acquired elements.

// 组件
<Input
     :value="item"     
     @on-blur="changeQaItem($event,index)"
/>


// method
changeQaItem(e,index){
    console.log(e);
    console.log(index);
}

2, with a return value of the default function, select a method such as a remote component, the parameters can not be written directly in the process, the function may be by means of an anonymous

// 组件
<Select
        v-model.trim="entitySearchValue"
        clearable
        filterable
        placeholder="请输入名称"
        :remote-method="v=>{entityNameSearch(v,'param')}"
      >
</Select>


// method
entityNameSearch(value,param){
    console.log(value);
    console.log(param);
}

Guess you like

Origin www.cnblogs.com/webhmy/p/10968777.html