当前位置:网站首页>el-table gets the data attribute of a row in the read data table
el-table gets the data attribute of a row in the read data table
2022-08-03 07:02:00 【m0_67391121】
el-table gets the data attribute of a row in the read data table, and changes the display method of processing a column of data
This article records the method of obtaining a row of data in the data table
1Click a row to get the data
Use @row-click and row
Write this method in the methods of js
test(row){console.log('clicked');console.log(row);console.log(row.title);}
The effect of the front-end inspection is as follows:
2 Change a column of data, process a column of data and display it again
For example, when you need to convert 0, 1, and 2 in the database that represent male, female, and other genders into Chinese characters in the table.Or make a column of data clickable, and so on.
Use scope.row.xxx to get the properties of this column of this row.
The code below is to make the id of the job clickable
{{scope.row.title}}
The following is to make the student's name clickable and change the gender from numbers to Chinese characters
{{scope.row.name}} {{sexChange(scope.row.sex)}}
Methods defined in js
//Gender character conversionsexChange(sex){if(sex==0){return 'male';}else if(sex==1){return 'female';}else {return 'other';}},
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
猜你喜欢
置顶文章-
empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType),
SVN客户端安装及操作文档
torch.nn.modules.activation.ReLU is not a Module subclass
我的Go+语言初体验——祝福留言小系统,让她也可以感受到你的祝福
Shell脚本--信号发送与捕捉
SQL——左连接(Left join)、右连接(Right join)、内连接(Inner join)
JDBC从手写连接到引用DBCP和C3P0
Redis-记一次docker下使用redis
Command errored out with exit status 1类似问题解决方案
随机推荐
Redis-记一次docker下使用redis
数据库OracleRAC节点宕机处理流程
contos install php-ffmpeg and tp5.1 using plugin
cnpm的安装与使用
你真的了解volatile关键字吗?
MySQL master-slave replication
CISP-PTE真题演示
JUC并发编程深入浅出!
【FCOS】FCOS理论知识讲解
AR路由器如何配置Portal认证(二层网络)
PostMan测试接口-----上传文件、导出excel
使用Contab调用Shell脚本执行expdp自动备份Oracle
HDI与普通PCB的4点主要区别
单节点部署 gpmall 商城系统(一)
cookie和session区别
微信小程序 - 监听 TabBar 切换点击事件
流式低代码编程,拖拽节点画流程图并运行
【IoU loss】IoU损失函数理解
C#通过WebBrowser对网页截图
process.env环境变量配置方式(配置环境变量区分开发环境和生产环境)