mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-10-28 23:48:21 +08:00
fix: fix codegen focus
This commit is contained in:
@ -6,7 +6,8 @@ import {
|
|||||||
onBeforeUnmount,
|
onBeforeUnmount,
|
||||||
defineProps,
|
defineProps,
|
||||||
defineEmits,
|
defineEmits,
|
||||||
onMounted
|
onMounted,
|
||||||
|
nextTick
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import { useLocalStorage } from "@vueuse/core";
|
import { useLocalStorage } from "@vueuse/core";
|
||||||
import "highlight.js/styles/github.css";
|
import "highlight.js/styles/github.css";
|
||||||
@ -53,17 +54,17 @@ const renderer = ref(props.renderer);
|
|||||||
const source = ref(null);
|
const source = ref(null);
|
||||||
watch(
|
watch(
|
||||||
() => props.open,
|
() => props.open,
|
||||||
val => {
|
async val => {
|
||||||
if (val) {
|
if (val) {
|
||||||
renderer.value = props.renderer;
|
renderer.value = props.renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
await nextTick();
|
||||||
if (initializing.value) {
|
|
||||||
return;
|
if (initializing.value) {
|
||||||
}
|
return;
|
||||||
source.value?.focus();
|
}
|
||||||
});
|
source.value?.focus();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -78,6 +79,9 @@ onMounted(async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
initializing.value = false;
|
initializing.value = false;
|
||||||
|
|
||||||
|
await nextTick();
|
||||||
|
|
||||||
source.value?.focus();
|
source.value?.focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user