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

FEATURE: 关于公共组件dropdown能否则支持鼠标滑动 #4465

Open
3 tasks done
catalpaUI opened this issue Sep 21, 2024 · 1 comment
Open
3 tasks done

FEATURE: 关于公共组件dropdown能否则支持鼠标滑动 #4465

catalpaUI opened this issue Sep 21, 2024 · 1 comment

Comments

@catalpaUI
Copy link

Version

Vben Admin V5

Description

本人对前端不是很熟悉,主要是做后台的
主要用的前端ui 也就bootstrap element plus
看vben新版本用了分层,我觉得特别棒
我这边打算在main区域里面的功能开发用elemnt plus
但是发现头部的公共组件 dropdown 不能滑动弹出 而且强制改成ep ui 或者重写 好像很不合理
但是对shadcn 这种实在是不会,所以看作者这边能否支持滑动
其实我在开发的场景中 除了main区域内,外部用到鼠标滑动的就是头像 嘿嘿

Proposed Solution

shadcn dropdown支持鼠标滑动

Alternatives Considered

No response

Additional Context

No response

Validations

  • Read the docs
  • Ensure the code is up to date. (Some issues have been fixed in the latest version)
  • I have searched the existing issues and checked that my issue does not duplicate any existing issues.
@mynetfan
Copy link
Collaborator

修改这个文件
packages/effects/layouts/src/widgets/user-dropdown/user-dropdown.vue
在script段插入一行:const menuOpen = ref(false);
template段第158行改为<DropdownMenu v-model:open="menuOpen">
第160行的div中插入@mouseenter="menuOpen = true"
大概如下:

...
const menuOpen = ref(false);
</script>

<template>
...
  <DropdownMenu v-model:open="menuOpen">
    <DropdownMenuTrigger>
      <div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full p-1.5" @mouseenter="menuOpen = true">

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

No branches or pull requests

2 participants