miniprogram-simulate icon indicating copy to clipboard operation
miniprogram-simulate copied to clipboard

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

Open LeeJim opened this issue 3 years ago • 2 comments

// 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 avatar Jan 12 '23 10:01 LeeJim

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

JuneAndGreen avatar Jan 13 '23 03:01 JuneAndGreen

感觉不可以

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

JuneAndGreen avatar Mar 20 '23 02:03 JuneAndGreen