diff --git a/examples/embed.tsx b/examples/embed.tsx index a42cc9157..3ff323418 100644 --- a/examples/embed.tsx +++ b/examples/embed.tsx @@ -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?.(); } }