mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-05-09 00:34:07 +08:00
♻️ 全面整理重构
This commit is contained in:
@@ -31,9 +31,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, nextTick, onMounted, reactive, ref, useTemplateRef, watch } from "vue";
|
||||
import { computed, onMounted, reactive, ref, useTemplateRef, watch } from "vue";
|
||||
|
||||
import { DialogCheckParams, DialogInputParams, DialogParams } from "./dialog.js";
|
||||
import type { DialogCheckParams, DialogInputParams, DialogParams } from "./dialog.js";
|
||||
|
||||
const defaultProp: DialogParams = { title: "", text: "", mode: "check", otcancel: false };
|
||||
const props = defineProps<DialogParams>();
|
||||
@@ -114,7 +114,7 @@ async function displayInputBox(params: DialogInputParams): Promise<string | fals
|
||||
data.otcancel = params.otcancel ?? true;
|
||||
show.value = true;
|
||||
return await new Promise<string | false | undefined>((resolve) => {
|
||||
nextTick(() => setTimeout(() => inputEl.value?.focus(), 100));
|
||||
setTimeout(() => inputEl.value?.focus(), 100);
|
||||
watch(
|
||||
() => show.value,
|
||||
() => setTimeout(() => resolve(inputVal.value), 500),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file component/func/geetest.ts
|
||||
* @description 封装自定义 geetest 组件,通过函数调用的方式,简化 geetest 的使用
|
||||
* @since Beta v0.5.1
|
||||
* @since Beta v0.6.6
|
||||
*/
|
||||
|
||||
import { h, render } from "vue";
|
||||
@@ -26,14 +26,14 @@ interface GeetestInstance extends ComponentInternalInstance {
|
||||
};
|
||||
}
|
||||
|
||||
const renderBox = (props: TGApp.Plugins.Mys.Geetest.reqResp): VNode => {
|
||||
function renderBox(props: TGApp.Plugins.Mys.Geetest.reqResp): VNode {
|
||||
const container = document.createElement("div");
|
||||
container.id = geetestId;
|
||||
const boxVNode: VNode = h(geetest, props);
|
||||
render(boxVNode, container);
|
||||
document.body.appendChild(container);
|
||||
return boxVNode;
|
||||
};
|
||||
}
|
||||
|
||||
let geetestInstance: VNode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user