# 明细表 select 下拉框选择事件


 onInited() {
      //注意:明细表操作需要写在onInited方法中
      //给明细表字段下拉框添加onChange事件
      this.detailOptions.columns.forEach(x => {
        if (x.field == '字段') {
          x.onChange = (row,column,  tableData) => {

            //下拉框选择时可以给其他字段设置值
            //row.xx='1312'

            console.log(JSON.stringify(row))
            //也可以select选择后从后台加载需要的数据
            //  this.http.post("xxx?参数="+row.ProductName,{},true).then(result=>{
            //   // row.xxx=result.xxx
            //  })
          }
        }
      })
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21