element-ui table组件中Table Events使用

页面效果

鼠标hover时显示当前行下可编辑的元素
在这里插入图片描述

table组件设置hover时背景颜色
一、直接修改css样式
.el-table .el-table__body tr:hover td {
    background-color: orange;
}
二、配合cell-mouse-enter cell-mouse-leave使用
handleMouseEnter(row, column, cell, event) {
  cell.classList.add(style)
}
Table Events 使用说明

在这里插入图片描述

实现
methods中
methods:{
 cellmouseenter(row, column, cell, event){
    console.log(row, column, cell, event)
   	this.templateRow = row.id; //存在相同的名字,加id区别
    this.templateName = row.pname;
    this.templateLocation = row.location.area;

    },
}
html中

在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是使用 SQL 的 INSERT INTO 语句生成 CREATE TABLE EVENTS 并插入 10 条记录的代码: ``` CREATE TABLE EVENTS ( event_id INT NOT NULL, time DATETIME, event_location VARCHAR(255), theme VARCHAR(255), participants VARCHAR(255), PRIMARY KEY (event_id) ); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (1, '2021-01-01 09:00:00', 'New York', 'New Year Party', 'John, Mary, Tom'); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (2, '2021-02-14 18:00:00', 'Paris', 'Valentine's Day Dinner', 'Peter, Jane'); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (3, '2021-03-08 12:30:00', 'London', 'Women's Day Seminar', 'Emily, Lucy, Kate'); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (4, '2021-04-22 10:00:00', 'Tokyo', 'Business Conference', 'David, Michael, Sarah'); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (5, '2021-05-01 14:00:00', 'Berlin', 'May Day Parade', 'Anna, James, Lisa'); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (6, '2021-06-18 19:30:00', 'Sydney', 'Music Festival', 'Alex, Emma, Oliver'); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (7, '2021-07-04 16:00:00', 'Washington D.C.', 'Independence Day Celebration', 'Robert, Sophie'); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (8, '2021-08-20 11:00:00', 'Dubai', 'International Trade Fair', 'Daniel, Rachel, Eric'); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (9, '2021-09-10 15:45:00', 'Beijing', 'Science and Technology Conference', 'Grace, Frank, Wendy'); INSERT INTO EVENTS (event_id, time, event_location, theme, participants) VALUES (10, '2021-10-31 20:00:00', 'Los Angeles', 'Halloween Party', 'Jack, Oliver, Mia'); ``` 请注意,这是一个示例代码,如果您的实际需求与此不同,请相应地修改代码。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值