iview中table里嵌套i-switch、input、select等

iview中table内嵌套

iview中table里嵌套i-switch、input、select等iview中table里嵌套i-switch、input、select等

input

 render:(h,params) => {
return h('Input',{
props: {
value:'',
size:'small',
},
on: {
input: (val) => {
t.data[params.index].estimateTime = val
}
},
})
}

select

 render: (h, params) => {
return h('Select',{
props:{
},
on: {
'on-change':(event) => {
this.data[params.index].volumeType = event;
}
},
},
params.row.action.map((item) =>{
return h('Option', {
props: {
value: item.value,
label: item.name
}
})
})
)
}

i-switch

render: (h, params) => {
//return h('元素',{元素的性质},'内容')
return h('i-switch', {
props: {
size: "large",
value: params.row.status == "true"
},
on: {
'on-change': (value) => {
params.row.status = value;
const th = this;
axios.get(th.url + '/departmentType/updateStatus', {
params: {
dId: params.row.dId,
status: value
}
}).then(function(res) {
if (res.data.code === 1028) {
th.$Message.success(res.data.message);
} else {
th.$Message.error(res.data.message);
th.changePage(1);
}
}) }
}
},
[h('span', {
slot: "open",
domProps: {
innerHTML: '正常'
}
}),
h('span', {
slot: "close",
domProps: {
innerHTML: '冻结'
}
}),
]
)
}

InputNumber

render: (h, params) => {
return h('div', [
h('InputNumber', {
props: {
size: "large",
value: params.row.dSort
},
on: {
'on-change': (value) => {
this.DepartmentType.dId =params.row.dId;
this.DepartmentType.dSort = value;
this.updateSort(); }
}
})
])
}
上一篇:Contest20140709 testA 树型DP


下一篇:VS2013 类向导 "异常来自 HRESULT:0x8CE0000B" 解决方法