# 所有商品的选择框
能搜索,能多选
# 效果
# 位置
文件目录:resources/src/view/friendHelp/components/selectGoodsBox.vue
# 使用示例
<selectGoodsBox v-show="isBoxShow" @close_box="closeBox" @select_box="selectBox" :tabArray="typeArr" :selectType="1"></selectGoodsBox>
1
import selectGoodsBox from '跟进相对路径引入'
export default {
components: {
selectGoodsBox
},
data() {
return {
isBoxShow: false,
typeArr: [6, 8, 5, 1, 2, 3, 4, 20, 22],
}
},
methods: {
showBox() {
this.isBoxShow = true
console.log(this.isBoxShow)
},
closeBox() {
this.isBoxShow = false
},
selectBox(data) {
console.log('data', data)
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 事件
参数 | 说明 | 参数 |
---|---|---|
close_box | 点击关闭按钮/取消按钮会触发按钮 | |
select_box | 选择商品之后点击确认会触发事件,并且会返回选择的商品的数组 | arr |
tabArray | 向组建传递一个数组,动态生成商品选择导航 | arr |
selectType | 组件选择类型,1单选,2多选,默认为2 | Number String |