码迷,mamicode.com
首页 > 其他好文 > 详细

iview table行render渲染不同的组件

时间:2018-09-05 19:55:31      阅读:442      评论:0      收藏:0      [点我收藏+]

标签:rop   bubuko   相同   param   render   ram   条件   ima   get   

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)
}
}
})
])
};
}
技术分享图片

iview table行render渲染不同的组件

标签:rop   bubuko   相同   param   render   ram   条件   ima   get   

原文地址:https://www.cnblogs.com/web-zqk/p/9593672.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!