Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Table] 右键菜单@row-mousedown e.preventDefault(); //阻止默认浏览器动作无效 #3027

Open
lzming9511 opened this issue Jan 9, 2024 · 2 comments
Assignees

Comments

@lzming9511
Copy link

tdesign-vue 版本

vue-next 1.6.8

重现链接

No response

重现步骤

` <t-table
ref="tableRef"
row-key="id"
:columns="showColumns"
:data="showData"
:bordered="bordered"
:size="size"
:pagination="showPagination"
@page-change="pageChange"
@row-mousedown="rowMousedown"

`

`const rowMousedown = ({e,row,index}) => {
console.log(row)

if ( e && e.preventDefault ){
e.preventDefault(); //阻止默认浏览器动作(W3C)
}else {
window.event.returnValue = false; //IE中阻止函数器默认动作的方式
}

if (e.button == 0) {
//左键
console.log("左键")
}
if (e.button == 1) {
//中键
console.log("中键")
}
if (e.button == 2) {
//右键
console.log("右键")
rightMenuVisible.value = true;
rightMenuStyle.value = {top: e.clientY + "px", left: e.clientX + "px"};
rightMenuRow.value = row;
}
};`

期望结果

No response

实际结果

右键菜单阻止不了

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

18

补充说明

No response

Copy link
Contributor

github-actions bot commented Jan 9, 2024

👋 @lzming9511,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

Copy link
Contributor

github-actions bot commented Jan 9, 2024

♥️ 有劳 @chaishi @nined9 @yanxugong @chuyueZhang 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @lzming9511

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants