iview table行render渲染不同的组件


table不同的行,相同的列渲染不同的组件,如图1:第一行渲染selece,第二行渲染input

render:(h,params)=>{
if(params.index === 0){ //以params.index为条件渲染
return h('div',[
h('Input',{
props:{

},
style:{},
on:{
'on-change':(e)=>{
console.log(e.target.value)
}
}
})
])
};
if(params.index === 1){
return h('div',[
h('Select',{
props:{

},
style:{},
on:{
'on-change':(e)=>{
console.log(e.target.value)
}
}
})
])
};
if(params.index === 2){
return h('div',[
h('InputNumber',{
props:{
min:0
},
style:{
width:'100%'
},
on:{
'on-change':(e)=>{
console.log(e.target.value)
}
}
})
])
};
}
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM