miniprogram-simulate
miniprogram-simulate copied to clipboard
开启 virtualHost 之后,无法获取组件实例
// 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
将 j-component 的 miniprogram-exparser 依赖更新到 2.29.1 版本试试,这个问题前段时间修了。
感觉不可以
给下具体可复现问题的 demo ?