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

[dialog] 通过esc按钮关闭弹窗出错 #4153

Open
KKDKK513 opened this issue Apr 28, 2024 · 5 comments · May be fixed by #4178
Open

[dialog] 通过esc按钮关闭弹窗出错 #4153

KKDKK513 opened this issue Apr 28, 2024 · 5 comments · May be fixed by #4178
Labels
to be published to be published

Comments

@KKDKK513
Copy link

KKDKK513 commented Apr 28, 2024

tdesign-vue-next 版本

可以

重现链接

https://github.com/KKDKK513/tDesign-dialog-issue.git

重现步骤

下载git项目,npm i 安装依赖。npm run dev 启动项目后在浏览器打开。
弹窗默认打开,因为src/demo.vue文件中,33行设置const visible = ref(true); 此时无法通过esc按钮关闭弹窗。
若修改为const visible = ref(false);啧打开弹窗后可以通过esc关闭弹窗。
请问这是bug吗?如果不是,如果我想默认打开一个全屏弹窗,通过esc关闭弹簧,又该如何操作呢

期望结果

如果是bug,希望修复。如果不是期望得到如何实现此场景的方法,谢谢!

实际结果

No response

框架版本

No response

浏览器版本

谷歌 版本 123.0.6312.123(正式版本) (64 位)

系统版本

No response

Node版本

18.18.0

补充说明

No response

Tasks

No tasks being tracked yet.
Copy link
Contributor

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

@boogie-ben
Copy link
Contributor

image

的确有这个问题,键盘事件要visible变更过才会设置上

@KKDKK513
Copy link
Author

KKDKK513 commented Apr 29, 2024

好的了解了,请问这个问题后续会修复吗?
我尝试这样去修改,但是还是未生效,
<script setup name="IndexPage"> import { reactive, onMounted, ref } from "vue" const dialogVisible = ref(true) dialogVisible.value = false dialogVisible.value = true </script>
或是这样
<script setup name="IndexPage"> import { reactive, onMounted, ref } from "vue" onMounted(() => { dialogVisible.value = false dialogVisible.value = true }) </script> 去使得dialogVisible的值变更,
还是无法生效。
目前我是默认值设置为false了,在onMounted周期中设置为true,目前也可以实现功能。

@uyarn
Copy link
Collaborator

uyarn commented Apr 29, 2024

先这样使用 问题我们在下个版本跟进修复

@KKDKK513
Copy link
Author

好的,谢谢

algerkong added a commit to algerkong/tdesign-vue-next that referenced this issue May 8, 2024
@uyarn uyarn added the to be published to be published label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be published to be published
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants