mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Merge pull request #8868 from 2betop/fix-jssdk-scope
fix: 修复 jssdk 模式通过 embed 返回的 scoped 获取组件失败的问题 Close: #8864
This commit is contained in:
commit
ce3b325457
@ -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?.();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user