fix: 子组件事件通知修复

This commit is contained in:
刘宗洋
2022-11-02 21:24:19 +08:00
parent ad616496d1
commit ac26a214bc
2 changed files with 13 additions and 12 deletions

View File

@@ -128,7 +128,7 @@
<script lang="ts" setup>
import { watch, toRefs, reactive, ref, getCurrentInstance } from 'vue';
import { watch, toRefs, reactive, ref } from 'vue';
import { TYPE_LIST, CHARACTER_SET_NAME_LIST, COLLATION_SUFFIX_LIST } from './service.ts';
import { ElMessage } from 'element-plus';
import SqlExecBox from './component/SqlExecBox.ts';
@@ -152,11 +152,9 @@ const props = defineProps({
})
//定义事件
const emit = defineEmits(['update:visible', 'cancel', 'val-change'])
const emit = defineEmits(['update:visible', 'cancel', 'val-change', 'submit-sql'])
const formRef: any = ref();
const { proxy } = getCurrentInstance() as any;
const state = reactive({
dialogVisible: false,
btnloading: false,
@@ -339,8 +337,7 @@ const submit = async () => {
dbId: props.dbId as any,
db: props.db,
runSuccessCallback: () => {
proxy.$parent.openEditTable({ tableName: state.tableData.tableName });
proxy.$parent.refreshTableInfo();
emit('submit-sql', {tableName: state.tableData.tableName });
// cancel();
},
});