当前位置:网站首页>There is a span tag. If you want to do click events on it, how can you expand the click area
There is a span tag. If you want to do click events on it, how can you expand the click area
2022-07-29 00:29:00 【qiansli12138】
Just thought of this demand , I wanted to span Add width and height , however span It's an in-line element , Width and height cannot be set .
By setting span Labeled padding Hold it up , But in front icon The icon will squeeze down , Just put icon The icon is set to absolute positioning , adopt left,top Set location , It's settled. .

<el-table :data="List" @row-click="rowClick" :height="tableConfig.height">
<el-table-column type="index" label="#">
</el-table-column>
<el-table-column prop="NAME" width="150" label=" full name " style="position:relative;" >
<template slot-scope="scope">// icon Icon
<i @dblclick="rowDlbClick(scope.row)" class="el-icon-user-solid solid_icon"></i>
// User name<span @dblclick="rowDlbClick(scope.row)" class="user_span"> { {scope.row.NAME}}</span>
</template>
</el-table-column><el-table>
</el-table>
.user_span {
user-select:none;
display: block;
padding: 12px 16px;
}
.solid_icon {
position: absolute;
top: 27px;
left: 10px;
}ps: By the way ,el-table Fixed header operation , Set up height The header can be fixed , The following content has scroll bars , Set the width according to the page :
data () {
return {
tableConfig: {
isLoading: true,
height: window.innerHeight - 200 // How many blanks are left below ( That is, how far is the bottom from the bottom )
}
}
}
Finally, clicking on the area around the name can also realize the click event !
边栏推荐
- Use hutool tool class to operate excel with more empty Sheet1
- 16.偏差、方差、正则化、学习曲线对模型的影响
- MySQL安装配置教程(超级详细、保姆级)
- 【开发教程10】疯壳·开源蓝牙心率防水运动手环-蓝牙 BLE 收发
- Software designer - intermediate, exam summary
- 2022dasctfjuly empowerment competition (reappearance)
- CV semantic segmentation model sketch (2)
- Attack and defense world web master advanced area php2
- Basic knowledge of PHP language (super detailed)
- vulnhub:Sar
猜你喜欢

Okaleido ecological core equity Oka, all in fusion mining mode

Attack and defense world web master advanced area web_ php_ include

Install mysql5.7 under Linux, super detailed complete tutorial, and cloud MySQL connection

DCAT in laravel_ Admin preliminary use record

Locally connect to redis on Windows Server

How to solve the problems of MQ message loss, duplication and backlog?

Dynamic programming problem (VII)

【飞控开发基础教程8】疯壳·开源编队无人机-I2C(激光测距)

Advanced area of attack and defense world web masters training www robots

The difference between {} and ${}
随机推荐
pnpm的安装与使用
Redis learning notes
刷题的第三十天
Attack and defense world web master advanced area web_ php_ unserialize
@PostConstruct注解详解
Introduction and solution of common security vulnerabilities in Web System SQL injection
CV target detection model sketch (2)
flyway的快速入门教程
【开发教程11】疯壳·开源蓝牙心率防水运动手环-整机功能代码讲解
Simple use and understanding of laravel message queue
Dynamic programming problem (1)
Oracle超全SQL,细节狂魔
I don't know how lucky the boy who randomly typed the log is. There must be a lot of overtime!
Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
Event extraction and documentation (2008-2017)
1331. Array sequence number conversion: simple simulation question
R语言怎么学
Attack and defense world web master advanced area php2
Laravel permission control
Still writing a lot of if to judge? A rule executor kills all if judgments in the project