当前位置:网站首页>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
边栏推荐
- 【英语单词】常见深度学习中编程用到的英语词汇
- Oracle 数据库集群常用巡检命令
- Content type ‘applicationx-www-form-urlencoded;charset=UTF-8‘ not supported“【已解决】
- linux安装redis
- 单节点部署 gpmall 商城系统(一)
- 【dllogger bug】AttributeError: module ‘dllogger‘ has no attribute ‘StdOutBackend‘
- MySQL的安装(详细教程)
- Command errored out with exit status 1类似问题解决方案
- mysql 数据去重的三种方式[实战]
- contos install php-ffmpeg and tp5.1 using plugin
猜你喜欢
随机推荐
国内首款PCB资料分析软件,华秋DFM使用介绍
SQL——左连接(Left join)、右连接(Right join)、内连接(Inner join)
FiBiNet torch复现
【设计指南】避免PCB板翘,合格的工程师都会这样设计!
SVN账号配置权限
linux安装redis
VB.net如何使用List类型
我的Go+语言初体验——祝福留言小系统,让她也可以感受到你的祝福
HDI与普通PCB的4点主要区别
MySQL之DQL——查询语言
【nohup】nohup命令的简单使用
Migration of BOA Server
Oracle数据文件收缩_最佳实践_超简单方法
Command errored out with exit status 1类似问题解决方案
IFM网络详解及torch复现
Zabbix历史数据清理(保留以往每个项目每天一条数据)
AQS、CAS、Synchronized小理解
MySQL的10种常用数据类型
【dllogger bug】AttributeError: module ‘dllogger‘ has no attribute ‘StdOutBackend‘
SQLSERVER将子查询数据合并拼接成一个字段