diff --git a/mayfly_go_web/src/views/ops/db/component/SqlExecBox.ts b/mayfly_go_web/src/views/ops/db/component/SqlExecBox.ts index 3dd9773b..1925bdbc 100644 --- a/mayfly_go_web/src/views/ops/db/component/SqlExecBox.ts +++ b/mayfly_go_web/src/views/ops/db/component/SqlExecBox.ts @@ -34,7 +34,7 @@ const SqlExecBox = (props: SqlExecProps): void => { if (boxInstance) { const boxVue = boxInstance.component // 调用open方法显示弹框,注意不能使用boxVue.ctx来调用组件函数(build打包后ctx会获取不到) - boxVue.proxy.open(props); + boxVue.exposed.open(props); } else { boxInstance = renderBox() SqlExecBox(props) diff --git a/mayfly_go_web/src/views/ops/db/component/SqlExecDialog.vue b/mayfly_go_web/src/views/ops/db/component/SqlExecDialog.vue index da2c7ea0..6f91e23e 100644 --- a/mayfly_go_web/src/views/ops/db/component/SqlExecDialog.vue +++ b/mayfly_go_web/src/views/ops/db/component/SqlExecDialog.vue @@ -70,7 +70,7 @@ const { dialogVisible, sqlValue, remark, - btnLoading + btnLoading, } = toRefs(state) state.sqlValue = props.sql as any; @@ -146,6 +146,9 @@ const open = (props: SqlExecProps) => { }); }); }; + +defineExpose({ open }) +