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

开启 virtualHost 之后,无法获取组件实例 #101

Open
LeeJim opened this issue Jan 12, 2023 · 2 comments
Open

开启 virtualHost 之后,无法获取组件实例 #101

LeeJim opened this issue Jan 12, 2023 · 2 comments

Comments

@LeeJim
Copy link

LeeJim commented Jan 12, 2023

// child.js
Component({
  options: {
    virtualHost: true,
  }
})
const id = simulate.load({
  template: `<child class="son" />`,
})
const comp = simulate.render(id);
comp.attach(document.createElement('parent-wrapper'));
const $search = comp.querySelector('.son'); // undefined

相关问题在基础库已经修复,但单测环境没有处理。

https://developers.weixin.qq.com/community/develop/issue/287

@LeeJim LeeJim changed the title 开启 virtualHost 之后,无法获取组件示例 开启 virtualHost 之后,无法获取组件实例 Jan 12, 2023
@JuneAndGreen
Copy link
Contributor

将 j-component 的 miniprogram-exparser 依赖更新到 2.29.1 版本试试,这个问题前段时间修了。

@JuneAndGreen
Copy link
Contributor

JuneAndGreen commented Mar 20, 2023

感觉不可以

给下具体可复现问题的 demo ?

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

2 participants