赞
踩
- <a-select
- style="width: 100%"
- show-search
- :default-active-first-option="false"
- :show-arrow="false"
- :filter-option="false"
- placeholder="请选择"
- v-model="value"
- @search="getList" // 搜索方法
- @change="Change"
- :getPopupContainer="
- (triggerNode) => {
- return triggerNode.parentNode
- }
- "
- >
- <a-select-option
- :key="item.branchId"
- :value="item.branchId"
- v-for="item in branchList"
- :channel="item"> //重点带上这个属性,那么选中值的整个对象就会在e.data.attrs.channel
- {{ item.name }}
- </a-select-option>
- </a-select>
-
-
- change(val, e) {
- console.log(val) // 选中值的value
- console.log(e.data.attrs.channel) //选中值的整个对象
- }
-
- getList(val) {
- if (!value) return
- const params = {
- name: value,
- current: 1,
- size: 50
- }
- Api(params).then((res) => {
- this.List = res.result
- })
- }
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。