当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
AR路由器如何配置Portal认证(二层网络)
国内首款PCB资料分析软件,华秋DFM使用介绍
UniApp 自定义条件编译详细使用流程
WinServer2012r2破解多用户同时远程登录,并取消用户控制
IFM网络详解及torch复现
contos install php-ffmpeg and tp5.1 using plugin
AlexNet网络详解及复现
Scala 高阶(七):集合内容汇总(上篇)
sql优化常用的几种方法
【云原生 · Kubernetes】Kubernetes简介及基本组件
快速理解JVM+GC
Nvidia NX使用向日葵远程桌面遇到的问题
FiBiNet torch复现
【multi_scale】多尺度训练——目标检测训练trick
【nohup】nohup命令的简单使用
【云原生 · Kubernetes】Kubernetes基础环境搭建
Oracle 数据库集群常用巡检命令
【应届生租房】应届生如何租房以及注意事项
一文读懂PCB品质体系认证
【onnx 输入尺寸】修改pytorch生成的onnx模型的输入尺寸









