Skip to content

Feat(tree-menu):[tree-menu] 树折叠时,支持悬浮展示子菜单列表,无子菜单时,悬浮展示tooltip #3183

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

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

hashiqi12138
Copy link
Contributor

@hashiqi12138 hashiqi12138 commented Mar 25, 2025

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #3105

What is the new behavior?

树折叠时,支持悬浮展示子菜单列表,无子菜单时,悬浮展示tooltip

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features
    • Enhanced tree menu components now support interactive pop-up submenus on hover with additional configuration options.
    • Introduced new demos, including one with keyword search and light/dark modes, to showcase dynamic tree menu interactions.
  • Style
    • Updated visual styling with new customizable CSS properties for a refined pop-up menu appearance.
  • Tests
    • Added automated tests to verify tree node interactions, visibility transitions, and filtering capabilities.

Sorry, something went wrong.

Copy link

coderabbitai bot commented Mar 25, 2025

Walkthrough

This pull request enhances the tree menu component by adding two new properties—expand-menu-popable and popper-class—to control the display of submenus. It introduces several new Vue components that implement pop-up submenu behavior in both Composition API and Classic API formats. A new demo and Playwright test have been added to demonstrate and verify the functionality. Additionally, the renderless function has been updated to enable dependency injection, and new CSS classes and variables support the styling of pop-up menus. The PC view has been refactored for conditional rendering using tooltips or pop-up menus.

Changes

File(s) Change Summary
examples/.../apis/tree-menu.js
packages/vue/.../src/props.ts
Added new properties (expand-menu-popable and popper-class) to the tree-menu component with default values and bilingual descriptions.
examples/.../pop-sub-menu-composition-api.vue
examples/.../pop-sub-menu.vue
packages/vue/.../src/menu-node.vue
packages/vue/.../src/pop-menu.vue
Introduced new Vue components for implementing and rendering tree menus with pop-up submenu functionality using both Composition API and TypeScript.
examples/.../pop-sub-menu.spec.ts Added Playwright tests to verify tree menu interactions, including node visibility, selection, and filtering.
examples/.../webdoc/tree-menu.js Added a new demo entry for the pop-up submenu feature, providing bilingual descriptions and linking to the relevant component.
packages/renderless/.../vue.ts Updated the renderless function to include the provide method for dependency injection, sharing the view model with child components.
packages/theme/.../index.less
packages/theme/.../vars.less
Added new CSS classes, prefixes, and custom properties to support styling for pop-up menus and panels in the tree menu.
packages/vue/.../src/pc.vue Refactored the tree menu's PC view to conditionally render tooltips or pop-up menus based on properties and node structure, integrating new components.

Sequence Diagram(s)

Loading
sequenceDiagram
    participant U as User
    participant T as TreeMenu (pc.vue)
    participant P as PopMenu (pop-menu.vue)
    participant N as MenuNode (menu-node.vue)
    
    U->>T: Click on tree node
    T->>T: Check expandMenuPopable & isExpand state
    alt Node has children
        T->>P: Render pop-up menu
        P->>N: Render submenu items
        U->>P: Click on submenu item
        P->>T: Update current node state
    else No children
        T->>T: Display tooltip with node label
    end

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • zzcr

Poem

I'm a rabbit, swift on the run,
Hopping through code under the sun.
New menus pop with a cheerful glow,
Tree nodes dancing, row by row.
With every change, my joy is spun 🐇!

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

examples/sites/demos/pc/app/tree-menu/pop-sub-menu-composition-api.vue

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

examples/sites/demos/pc/app/tree-menu/pop-sub-menu.spec.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

examples/sites/demos/pc/app/tree-menu/pop-sub-menu.vue

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

  • 7 others
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sorry, something went wrong.

Copy link

Walkthrough

此PR为树形菜单组件添加了一个新功能:在树折叠时支持悬浮展示子菜单列表,并在无子菜单时悬浮展示tooltip。此功能通过新增属性expand-menu-popablepopper-class实现,并在多个文件中进行了相应的实现和样式调整。

Changes

文件 概要
examples/sites/demos/apis/tree-menu.js 添加了expand-menu-popablepopper-class属性的定义和描述。
examples/sites/demos/pc/app/tree-menu/pop-sub-menu-composition-api.vue 新增了一个示例文件,展示了新功能的使用。
examples/sites/demos/pc/app/tree-menu/pop-sub-menu.spec.ts 新增了测试文件,测试新功能的正确性。
examples/sites/demos/pc/app/tree-menu/pop-sub-menu.vue 新增了一个示例文件,展示了浅色和深色模式下的新功能。
examples/sites/demos/pc/app/tree-menu/webdoc/tree-menu.js 更新了文档,添加了新功能的描述。
packages/renderless/src/tree-menu/vue.ts 在renderless函数中添加了provide方法,支持新功能。
packages/theme/src/tree-menu/index.less 添加了新功能相关的样式定义。
packages/theme/src/tree-menu/vars.less 定义了新功能相关的样式变量。
packages/vue/src/tree-menu/src/menu-node.vue 新增了一个组件文件,用于渲染树节点。
packages/vue/src/tree-menu/src/pc.vue 修改了树节点的渲染逻辑,支持新功能。
packages/vue/src/tree-menu/src/pop-menu.vue 新增了一个组件文件,用于渲染弹出菜单。
packages/vue/src/tree-menu/src/props.ts 添加了expand-menu-popablepopper-class属性的定义。

setup() {
const treeMenuVm = hooks.inject('tree-menu')

function onClickItem(item) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function onClickItem directly modifies the state of treeMenuVm by calling setCurrentNode. Ensure that this operation is safe and does not lead to unintended side effects, especially in a reactive environment where state changes can trigger additional computations or renders.

Copy link

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Walkthrough

This PR adds a new feature to the tree menu component: support for floating display submenu lists when tree collapses, and suspend display tooltip when there is no submenu. This function is implemented by adding the properties expand-menu-popable and popper-class, and has been implemented and styled in multiple files.

Changes

Documents Summary
examples/sites/demos/apis/tree-menu.js Added definition and description of the expand-menu-popable and popper-class properties.
examples/sites/demos/pc/app/tree-menu/pop-sub-menu-composition-api.vue Added a sample file to show the use of new features.
examples/sites/demos/pc/app/tree-menu/pop-sub-menu.spec.ts Added a test file to test the correctness of the new functions.
examples/sites/demos/pc/app/tree-menu/pop-sub-menu.vue Added an example file showing new features in light and dark modes.
examples/sites/demos/pc/app/tree-menu/webdoc/tree-menu.js Updated documentation and added descriptions of new features.
packages/renderless/src/tree-menu/vue.ts Added a provide method in the renderless function to support new functions.
packages/theme/src/tree-menu/index.less Added style definitions related to new features.
packages/theme/src/tree-menu/vars.less Defines style variables related to the new feature.
packages/vue/src/tree-menu/src/menu-node.vue Added a component file for rendering tree nodes.
packages/vue/src/tree-menu/src/pc.vue Modified the rendering logic of the tree node and supports new functions.
packages/vue/src/tree-menu/src/pop-menu.vue Added a component file for rendering pop-up menus.
packages/vue/src/tree-menu/src/props.ts Added definitions for the expand-menu-popable and popper-class properties.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (9)
examples/sites/demos/pc/app/tree-menu/pop-sub-menu.spec.ts (1)

1-26: Well-structured test for the new feature

The test verifies essential tree menu functionality including node visibility, interaction, and filtering. It validates the key user interactions that would be expected with the new submenu hover display feature.

However, this test doesn't appear to specifically test the new hover functionality mentioned in the PR title ("树折叠时,支持悬浮展示子菜单列表"). Consider adding test coverage for this specific feature to ensure it works as expected.

packages/vue/src/tree-menu/src/menu-node.vue (2)

39-44: Props lack type definitions

The props are defined without TypeScript types, which reduces type safety and IDE support. Add proper type definitions to improve code quality.

Add proper type definitions to the props:

props: {
-  node: {},
-  data: {},
-  suffixIcon: {},
-  getTitle: {}
+  node: {
+    type: Object,
+    required: true
+  },
+  data: {
+    type: Object,
+    required: true
+  },
+  suffixIcon: {
+    type: [Object, Function],
+    default: null
+  },
+  getTitle: {
+    type: Function,
+    required: true
+  }
},

46-48: Unnecessary empty setup function

The setup function returns an empty object, which is redundant. If no reactive state or computed properties are needed, you can simplify by removing the empty return.

Simplify the setup function:

setup() {
-  return {}
}

Or remove it entirely if no other functionality is planned:

-setup() {
-  return {}
-}
packages/theme/src/tree-menu/index.less (1)

350-413: Comprehensive styling for pop-up menu panel

The styling for the pop-up menu panel is well-structured and covers all necessary visual aspects including padding, border-radius, box-shadow, and item states (hover, active, current). These styles properly implement the UI requirements for the new hover-based submenu display functionality.

One improvement would be to add comments to explain the purpose of the CSS variables being used, especially for the transform properties that handle positioning.

packages/vue/src/tree-menu/src/pop-menu.vue (2)

1-2: Consider removing the eslint-disable vue/no-mutating-props directive
Disabling this lint rule can mask potential issues if props are ever mutated, which can break Vue’s unidirectional data flow.


88-104: Potential performance concern for large trees
The recursive approach is correct, but repeated checks on large, deeply nested structures might affect performance. Consider adding a short-circuit or memoization if the tree size grows.

packages/vue/src/tree-menu/src/pc.vue (1)

81-90: Handle tooltip for empty child nodes
Displaying a tooltip for nodes without submenus ensures a clear user experience. Consider edge cases like extremely long or missing labels to prevent tooltip overflow or blank pop-ups.

packages/theme/src/tree-menu/vars.less (2)

87-90: Clarify Comment for Shadow Property
The comment on line 89 currently repeats "弹出面板 圆角," which is appropriate for a border-radius property (line 88) but misleading here. Since the property is for box-shadow, consider updating the comment to something like "弹出面板 阴影" to accurately reflect its purpose.


103-104: Correct Comment for Padding-Left Property
The comment on line 103 incorrectly states "弹出面板 选中文本色" while the property defined on line 104 sets the left padding. Please update the comment to describe the left padding, e.g., "弹出面板 内边距" or "弹出面板 左侧内边距," to avoid confusion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9cf817a and efbdd88.

📒 Files selected for processing (12)
  • examples/sites/demos/apis/tree-menu.js (1 hunks)
  • examples/sites/demos/pc/app/tree-menu/pop-sub-menu-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/tree-menu/pop-sub-menu.spec.ts (1 hunks)
  • examples/sites/demos/pc/app/tree-menu/pop-sub-menu.vue (1 hunks)
  • examples/sites/demos/pc/app/tree-menu/webdoc/tree-menu.js (1 hunks)
  • packages/renderless/src/tree-menu/vue.ts (2 hunks)
  • packages/theme/src/tree-menu/index.less (4 hunks)
  • packages/theme/src/tree-menu/vars.less (1 hunks)
  • packages/vue/src/tree-menu/src/menu-node.vue (1 hunks)
  • packages/vue/src/tree-menu/src/pc.vue (3 hunks)
  • packages/vue/src/tree-menu/src/pop-menu.vue (1 hunks)
  • packages/vue/src/tree-menu/src/props.ts (1 hunks)
🔇 Additional comments (17)
packages/vue/src/tree-menu/src/props.ts (1)

70-74: New properties look good and follow established patterns.

The addition of expandMenuPopable and popperClass properties enhances the tree menu component functionality, allowing for pop-up submenu display when collapsed. The property types, default values, and placement in the file are consistent with existing code patterns.

examples/sites/demos/pc/app/tree-menu/webdoc/tree-menu.js (1)

153-164: Demo entry follows project conventions.

The new demo entry for pop-up submenus is properly structured with bilingual names and descriptions, consistent with other demo entries in the file. It's appropriately placed in the list and references the corresponding Vue file.

examples/sites/demos/pc/app/tree-menu/pop-sub-menu.vue (4)

1-20: Component template structure is well-organized.

The template demonstrates both light and dark mode variants of the pop-up submenu feature. The expand-menu-popable property is correctly applied to both instances, and the dark mode properly uses the popperClass property for custom styling.


22-149: Data structure and component setup are appropriate.

The script section properly imports required components and icons, and defines a comprehensive data structure for the demo. The tree data includes both nodes with and without children, which is excellent for demonstrating this feature.


151-161: Responsive layout using Flexbox.

The scoped styles implement a clean, responsive layout using Flexbox, which is a good approach. The spacing between menu examples is well-defined.


162-184: Well-structured CSS custom properties for dark theme.

The CSS for the dark theme is well-organized using CSS custom properties. All relevant component parts are styled consistently. The approach of using a single class name passed to both the component and the popper is an elegant solution.

examples/sites/demos/apis/tree-menu.js (1)

345-367: API documentation is clear and comprehensive.

The new properties expand-menu-popable and popper-class are well-documented with clear descriptions in both Chinese and English. The properties are correctly configured with appropriate types, default values, and mode settings, and are linked to the demo example.

examples/sites/demos/pc/app/tree-menu/pop-sub-menu-composition-api.vue (2)

1-3: Component correctly implements the new feature

The template properly implements the new expand-menu-popable property on the tiny-tree-menu component, which aligns with the PR objective of supporting hover-based submenu display when the tree is collapsed.


51-54:

❓ Verification inconclusive

Empty URL attributes

There are several menu items with empty URL attributes (url: ''). Consider either removing these empty URL properties or filling them with appropriate values.

Check if these empty URLs are intentional or if they should point to actual resources:


🏁 Script executed:

#!/bin/bash
# Check if there are other examples of empty URLs in tree-menu components
grep -r "url: ''" --include="*.vue" examples/sites/demos/pc/app/tree-menu/

Length of output: 33548


Attention: Clarification Needed on Empty URL Attributes in Demo Menu Components

Our verification shows that the use of empty URL attributes (url: '') is consistent across all tree-menu demo Vue files (including the snippet in pop-sub-menu-composition-api.vue, lines 51–54). If these empty URLs are intended as placeholders (for example, to indicate non-clickable or demo-only items), please add a comment or documentation to clarify this decision. Otherwise, if these properties are expected to link to actual resources in the future, please update them accordingly for consistency across the demos.

  • Affected file snippet (pop-sub-menu-composition-api.vue, lines 51–54):
            { id: 30102, label: 'Datepicker 日期', url: '' },
            { id: 30103, label: 'Dropdown 下拉框', url: '' },
            { id: 30104, label: 'DropTimes 下拉时间', url: '' },
            { id: 30105, label: 'Input 输入框', url: '' }
packages/theme/src/tree-menu/index.less (2)

20-21: Well-defined class prefixes for new functionality

The new CSS class prefixes for pop-up menu elements follow the established naming conventions of the codebase, making the code more maintainable.


345-348: Simple and clean styling for pop-up menu

The .@{tree-pop-menu-prefix-cls} class with line-height: initial properly resets the line height for pop-up menus, ensuring proper rendering of menu items.

packages/vue/src/tree-menu/src/pop-menu.vue (1)

83-85: Clarify the logic for current node
hasCurrent returns false when the node itself is isCurrent, while it recurses for child nodes. Verify if excluding the node’s own state is intended or if this needs adjustment to include the node itself.

packages/renderless/src/tree-menu/vue.ts (1)

80-80: Ensure safe usage of the shared VM injection
Providing 'tree-menu' in the renderless function allows child components to access the main tree menu context. Verify that child components do not unintentionally override this injection, and confirm they rely on this pattern to avoid undefined references.

Also applies to: 131-131

packages/vue/src/tree-menu/src/pc.vue (3)

91-96: Pop-up menu integration
The conditional rendering of TinyTreeMenuPopMenu supports hover-based submenus. Confirm that nested child data is valid and won’t break the pop-up for deeper levels.


98-100: Graceful fallback rendering
Falling back to TinyTreeMenuNode when expandMenuPopable or state.isExpand is disabled maintains consistent behavior across the tree menu.


117-119: Validate component imports and dependencies
Newly imported TinyTooltip, TinyTreeMenuPopMenu, and TinyTreeMenuNode components should be verified in package dependencies. Ensure they’re properly listed in the correct configuration files and that no version conflicts arise.

packages/theme/src/tree-menu/vars.less (1)

85-108: Overall Approval for New Pop-Up Panel Custom Properties
The new CSS custom properties for the pop-up panel (padding, radius, shadow, item dimensions, and colors) are well structured and follow a consistent naming convention. They provide enhanced styling flexibility for the tree menu component in collapsed mode.

Comment on lines +13 to +14
customIcon: iconApp()
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing icon imports will cause runtime errors

The component references custom icon functions like iconApp(), iconExpressSearch(), etc., but these functions are not imported in the script section.

Add the necessary imports at the top of your script section:

import { TinyTreeMenu } from '@opentiny/vue'
import { ref } from 'vue'
+import { 
+  iconApp, 
+  iconExpressSearch, 
+  iconTotal, 
+  iconUnfreeze, 
+  iconFile 
+} from '@opentiny/vue-icon'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
customIcon: iconApp()
},
<script>
import { TinyTreeMenu } from '@opentiny/vue'
import { ref } from 'vue'
import {
iconApp,
iconExpressSearch,
iconTotal,
iconUnfreeze,
iconFile
} from '@opentiny/vue-icon'
// ... rest of your script code
export default {
// component definition, etc.
data() {
return {
customIcon: iconApp()
}
}
}
</script>

Comment on lines +29 to +37
import { defineComponent } from '@opentiny/vue-common'
import Popover from '@opentiny/vue-popover'

export default defineComponent({
name: 'TreeMenuNode',
componentName: 'TreeMenuNode',
components: {
TinyPopover: Popover
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Imported but unused component

The component imports Popover and registers it as TinyPopover, but it's not used anywhere in the template.

Either remove the unused import and component registration, or implement the Popover functionality if it's meant to be part of this component:

import { defineComponent } from '@opentiny/vue-common'
-import Popover from '@opentiny/vue-popover'

export default defineComponent({
  name: 'TreeMenuNode',
  componentName: 'TreeMenuNode',
-  components: {
-    TinyPopover: Popover
-  },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { defineComponent } from '@opentiny/vue-common'
import Popover from '@opentiny/vue-popover'
export default defineComponent({
name: 'TreeMenuNode',
componentName: 'TreeMenuNode',
components: {
TinyPopover: Popover
},
import { defineComponent } from '@opentiny/vue-common'
export default defineComponent({
name: 'TreeMenuNode',
componentName: 'TreeMenuNode',
// other component options can be added here if needed
})

@zzcr
Copy link
Member

zzcr commented Mar 25, 2025

在标题中可以用:[tree-menu] 触发下e2e测试用例哈,可以参考下其他的mr或者贡献指南

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


You can use: [tree-menu] to trigger the e2e test case. You can refer to other mr or contribution guides.

@hashiqi12138 hashiqi12138 changed the title Feat(tree-menu):树折叠时,支持悬浮展示子菜单列表,无子菜单时,悬浮展示tooltip Feat(tree-menu):[tree-menu] 树折叠时,支持悬浮展示子菜单列表,无子菜单时,悬浮展示tooltip Mar 26, 2025
@kagol kagol added the enhancement New feature or request (功能增强) label Mar 26, 2025
@wuyiping0628
Copy link
Collaborator

wuyiping0628 commented Apr 15, 2025

e2e测试报错解决一下

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


e2e tests are kept resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request (功能增强)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants