当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
【dllogger bug】AttributeError: module ‘dllogger‘ has no attribute ‘StdOutBackend‘
Oracle 数据库集群常用巡检命令
Mysql去除重复数据
国内首款PCB资料分析软件,华秋DFM使用介绍
MySQL中的行锁
【OpenStack云平台】搭建openstack云平台
cnpm的安装与使用
torch.nn.modules.activation.ReLU is not a Module subclass
【干货分享】PCB 板变形原因!不看不知道
FiBiNet torch复现
el-tree设置利用setCheckedNodessetCheckedKeys默认勾选节点,以及通过setChecked新增勾选指定节点
MySql之json_extract函数处理json字段
PHP Composer常用命令积累
C # to switch input method
pyspark---低频特征处理
SQL——左连接(Left join)、右连接(Right join)、内连接(Inner join)
Scala 高阶(七):集合内容汇总(上篇)
【FCOS】FCOS理论知识讲解
el-tabs(标签栏)的入门学习
【入职第一篇知识总结- Prometheus】







