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

在开启mergeVirtualHostAttributes时,不会对已有id的自定义组件生成id #5282

Open
NoahSun opened this issue Jan 7, 2025 · 0 comments

Comments

@NoahSun
Copy link

NoahSun commented Jan 7, 2025

export function createVirtualHostId(

在manifest.config.ts中设置

{
   'mp-weixin': {
      mergeVirtualHostAttributes: true,
   }
}

分包页面

<!-- /page-sub/index/index.vue -->
<template>
  <Test />
</template>


<script lang="ts" setup>
  import Test from './components/test.vue';
</script>

分包组件

<!-- /page-sub/index/components/test.vue -->
<template>
  <view id="test-id">aaaa</view>
</template>

<script setup></script>

实际效果:

渲染出来的view上的id消失了

image

开发环境:
uniapp 版本:3.0.0-4040520250104002
微信小程序基础库:3.7.3
微信开发者工具:Nightly 1.06.2412302

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

1 participant