批量操作取值调接口

批量操作取值调接口

selectionChange(val) {
				var arr = [];//数组置空
				if(val.length) {/////////////切记,判断取值数组的的长度
					for(var i = 0; i < val.length; i++) {
						arr.push(val[i].id)//追加你需要的id
						this.selectedId = arr
					}
					this.selectShow = true
				} else {
					this.selectedId = []//切记没值的时候还要置空数组
					this.selectShow = false
				}
				this.$emit('selectionChange', this.selectedId)//子组件更新父组件,并把值带过去
			},
posted @ 2018-05-25 17:08  李美玲  阅读(167)  评论(0编辑  收藏  举报