iview table中的render函数使用
1.表格列数据内容过多可以用以下两个属性解决:
ellipsis:"true',
tooltip:true
使每个列的内容如果过多的话变为省略号
2.table中的render函数(实现根据表格内容条件是否展示按钮)
columns:[
{
title:'审批状态',
key:'status',
render:(h,params)=>{
const status = params.row.status;
var text = ''
switch(status){
case 100:
text = '待审核',
break;
case 200:
text = '审核未通过'
break;
case 300:
text = '审核通过'
break;
}
return h('div',text)
}
},
{
title:'操作',
key:"oprator",
render:(h,params)=>{
let arr = []
if(params.row.status === '100'){
arr.push(
h(
"Button",
{
props:{
type:"warning",
size:"small",
icon:"md-create"
},
style:{
marginRight:"5px"
},
on:{
lick:()=>{
this.applyDetail(params.row.demandId);
}
}
},
"申请详情"
)
)
}
return h('div',arr)
}
}
]
iview table中的render函数使用的更多相关文章
- iview table表中使用render函数props传值出现问题
使用iview中的table表格时避免不了使用render函数渲染自定义内容,或者渲染组件.但是在正常使用时出现了props传值无法识别, 按照官网介绍使用props如下: render: (h, p ...
- vue中的render函数介绍
简介:对于不了解slot的用法(参考:大白话vue-slot的用法)又刚接触render函数的同学来说,官网的解释无疑一脸懵逼,这里就整理下个人对render函数的理解 问题: 1.render函数是 ...
- Vue2.x中的Render函数
Render函数是Vue2.x版本新增的一个函数:使用虚拟dom来渲染节点提升性能,因为它是基于JavaScript计算.通过使用createElement(h)来创建dom节点.createElem ...
- Vue中的render函数随笔
使用vue-cli创建项目后,再main.js里面有这样一段代码: new Vue({ render:h => h(App) }).$mount('#app') render函数是渲染一个视图, ...
- vue iView table中render渲染
<template> <div class="srm-page"> <el-form ref="form" :model=&quo ...
- 在vue中结合render函数渲染指定的组件到容器中
1.demo 项目结构: index.html <!DOCTYPE html> <html> <head> <title>标题</title> ...
- iview table中使用Poptip
h('Poptip', { props: { confirm: true, // 'ok-text':"yes", // 'cancel-text':"no", ...
- iview中table的render()函数
Vue 推荐在绝大多数情况下使用 template 来创建你的 HTML.然而在一些场景中,你真的需要 JavaScript 的完全编程的能力,这就是 render 函数,它比 template 更接 ...
- iview使用之怎样通过render函数在tabs组件中添加标签
在实际项目开发中我们通常会遇到一些比较'新颖'的需求,而这时iview库里往往没有现成可用的组件示例,所以我们就需要自己动手翻阅IviewAPI进行自定义一些组件,也可以说是将iview库里的多种组件 ...
随机推荐
- oralce MTS
MTS的组件包括: processes on the system. communication software. the shared global section (SGA). ...
- cloud-music
非常感谢那些无私开源的程序员,希望我也能够有能力像你们那样,开源很多很有意思的东西~~ //index.html <!DOCTYPE html> <html> <head ...
- 设置onselectstart在ie浏览器下对于input及textarea标签页会生效
设置onselectstart在ie浏览器下对于input及textarea标签页会生效, 可以使用js来控制对于某种标签不生效,代码如下: document.onselectstart = disa ...
- Oracle日期
oracle 日期格式 to_date("要转换的字符串","转换的格式") 两个参数的格式必须匹配,否则会报错. 即按照第二个参数的格式解释第一个参数. ...
- Kubernetes1.4正式发布
Kubernetes1.4正式发布. 昨天刚预测1.4即将正式发布,结果晚上Kubernetes1.4就正式发布了. 先看看Kubernetes发布历史: Kubernetes 1.0 - 2015年 ...
- SPA是什么?
认识SPA 最早单页面的应用无从知晓,在2004年,google的Gmail就使用了单页面.到了2010年,随着Backbone的问世之后,此概念才慢慢热了起来. 随着后来React.Angular. ...
- linux查看用户组所有成员
1.grep 'user1' /etc/group //找出用户组的gid user1:x:1004://得出gid=1004 2. awk -F":" '{print $1&qu ...
- @hdu - 6687@ Rikka with Stable Marriage
目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定一个稳定婚姻匹配问题,其中第 i 个男生与第 j 个女生之间 ...
- Python操作pymysql写入数据库时的错误
错误一 InternalError: (pymysql.err.InternalError) (1366, "Incorrect string value: '\\xE6\\xAD\\xA3 ...
- iOS编译错误#ld: warning: ignoring file# 之 Undefined symbols for architecture x86_64 - ld: symbol(s) not found for architecture x86_64
ld: warning: ignoring file xxxPath/libbaidumapapi.a, missing required architecture x86_64 in file xx ...