提交 497939e0 编写于 作者: fxy060608's avatar fxy060608

fix(mp-toutiao): handle edge case of selectAllComponents (#3954)

上级 42168591
......@@ -4829,9 +4829,10 @@ function setRef(instance, isUnmount = false) {
}
const check = $mpPlatform === 'mp-baidu' || $mpPlatform === 'mp-toutiao';
const doSetByRefs = (refs) => {
const mpComponents = $scope
.selectAllComponents('.r')
.concat($scope.selectAllComponents('.r-i-f'));
const mpComponents =
// 字节小程序 selectAllComponents 可能返回 null
// https://github.com/dcloudio/uni-app/issues/3954
($scope.selectAllComponents('.r') || []).concat($scope.selectAllComponents('.r-i-f') || []);
return refs.filter(templateRef => {
const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
// 部分平台,在一些 if 条件下,部分 slot 组件初始化会被延迟到下一次渲染,需要二次检测
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册