1 如果要在标签中加入属性,例如img 中src属性 a标签中href属性 此时需要用到----attrs 来加入而不是props
2 动态显示内容:
render: (h,params) => {
const row = params.row;
const color = row.appraisalReport === '1'?'blue': 'red';
const text1= row.appraisalReport === '1' ?'未上传' : '';
const text2= row.appraisalReport === '1' ?'查看' : '上传';
return h('div',[h('p',{
props: {
// type: 'primary',
// size: 'small'
},
style:{
color:color
// marginRight: '5px'
}
},text1),
3.对样式的部分修改:
style:{
height:'30px',
width:'70px',
backgroundColor: 'white',-------以前是: background-color:'white',
marginRight:'10px',-----同理改为这样的;
marginBottom:'10px'
}
4.slot直接与style 评级设置
slot:'content',
style:{
paging:'10px'
}
4.input 的type 以及nane:设置:
h('input',{
domProps: {type:'radio',
name:rowName
},
props:{//使用props传递数据
level:{
// type:'radio'
}
5.iview的组件不是style下的width设置 仅仅是组件的width设置:
h('Poptip',{
// domProps: {
// width:'150'
// },
props:{
width:'250'
}
},
6. 对<select> 中的<option>设置value:
h('option',{
domProps:{value:'1'}
},'特优'), },