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