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

给组件的唯一根元素设置id时,在小程序端id为空 #5364

Closed
sutras opened this issue Mar 24, 2025 · 2 comments
Closed

给组件的唯一根元素设置id时,在小程序端id为空 #5364

sutras opened this issue Mar 24, 2025 · 2 comments
Assignees

Comments

@sutras
Copy link

sutras commented Mar 24, 2025

发行方式

小程序

具体平台

微信小程序和支付宝小程序

开发环境

macOS

项目创建方式

CLI命令行

依赖版本

{ "@dcloudio/uni-app": "3.0.0-4050620250312001" }

问题描述

给组件的唯一根元素设置id时,在小程序端id为空,h5和app-vue正常。

如果组件有多个根元素,可以正常设置id;
如果设置id的元素位于非根元素,可以正常设置id。

重现步骤

  1. manifest.json 文件中,设置支付宝和微信下 mergeVirtualHostAttributestrue;
  2. 给某个组件的唯一根节点设置id;
  3. 编译到微信或支付宝;
  4. 在开发者工具调试器下的“元素”面板选择元素;

期望行为

No response

实际行为

No response

截图或录屏

No response

@Otto-J
Copy link
Member

Otto-J commented Mar 25, 2025

更新:问题已复现

提供下 vue 和 HBuilderX 依赖版本,并提供一个复现工程进行说明。说明预期行为和实际结果。提供更多信息,有助于定位和解答你的问题。

@Wangyaqi
Copy link
Contributor

感谢反馈,此问题会在下次发布alpha时修复。fix(mp): 修复启用mergeVirtualHostAttribute时部分情况下组件id错误的Bug

@sutras sutras closed this as completed Mar 29, 2025
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

3 participants