iview表格里面自定义样式

版权声明:未经本人同意不得转载 一切法律责任 后果自负 https://blog.csdn.net/xy19950125/article/details/91044547

表格里面需要动态添加样式;例如表头加粗,不同的背景颜色。。。。

    {
        title: "启用状态",
        key: "state",
        align: "center",
        minWidth: 100,
        render:(h,params)=>{
          return h(
            'div',
             {
             style:{
              background:params.row.state==1?'#cc0000':'#669900',
              color:'#ffffff',
              padding:'5px 0'
              }
             },
            params.row.state =='0'?'是':'否'
          )
        }
     },

猜你喜欢

转载自blog.csdn.net/xy19950125/article/details/91044547
今日推荐