fix: 修复 jssdk 模式通过 embed 返回的 scoped 获取组件失败的问题 Close: #8864

This commit is contained in:
2betop 2023-11-23 15:10:06 +08:00
parent 8f1638cce8
commit 1e180df2f6

View File

@ -259,7 +259,13 @@ export function embed(
...props,
scopeRef: (ref: any) => {
if (ref) {
Object.assign(scoped, ref);
Object.keys(ref).forEach(key => {
let value = ref[key];
if (typeof value === 'function') {
value = value.bind(ref);
}
(scoped as any)[key] = value;
});
callback?.();
}
}