mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:39:05 +08:00
chore: sdk embed 方法添加 callback 在 callback 中可确保 scoped 方法是可用的 (#5698)
* publish beta * chore: sdk embed 方法添加 callback 在 callback 中可确保 scoped 方法是可用的
This commit is contained in:
parent
ee472ec367
commit
fdb09001e1
@ -27,7 +27,8 @@ export function embed(
|
||||
container: string | HTMLElement,
|
||||
schema: any,
|
||||
props: any = {},
|
||||
env?: any
|
||||
env?: any,
|
||||
callback?: () => void
|
||||
) {
|
||||
const __ = makeTranslator(env?.locale || props?.locale);
|
||||
|
||||
@ -259,7 +260,10 @@ export function embed(
|
||||
...amisProps,
|
||||
...props,
|
||||
scopeRef: (ref: any) => {
|
||||
if (ref) Object.assign(scoped, ref);
|
||||
if (ref) {
|
||||
Object.assign(scoped, ref);
|
||||
callback?.();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -34,7 +34,9 @@
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"@types/marked": "^4.0.7",
|
||||
"@types/prismjs": "^1.26.0",
|
||||
"@types/react-dom": "^18.0.8",
|
||||
"@vitejs/plugin-react": "^2.2.0",
|
||||
"copy-to-clipboard": "3.3.1",
|
||||
"echarts": "5.4.0",
|
||||
"express": "^4.18.2",
|
||||
"fis-optimizer-terser": "^1.0.1",
|
||||
@ -58,20 +60,19 @@
|
||||
"lerna": "^5.5.2",
|
||||
"magic-string": "^0.26.7",
|
||||
"marked": "^4.2.1",
|
||||
"monaco-editor": "0.30.1",
|
||||
"plugin-react-i18n": "^0.0.20",
|
||||
"prismjs": "^1.29.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-overlays": "5.1.1",
|
||||
"rollup-pluginutils": "^2.8.2",
|
||||
"setprototypeof": "^1.2.0",
|
||||
"ts-jest": "^29.0.2",
|
||||
"vite": "^3.2.2",
|
||||
"vite-plugin-monaco-editor": "^1.1.0",
|
||||
"vite-plugin-svgr": "^2.2.2",
|
||||
"zrender": "^5.3.2",
|
||||
"monaco-editor": "0.30.1",
|
||||
"react-overlays": "5.1.1",
|
||||
"copy-to-clipboard": "3.3.1"
|
||||
"zrender": "^5.3.2"
|
||||
},
|
||||
"jest": {
|
||||
"verbose": true,
|
||||
|
Loading…
Reference in New Issue
Block a user