♻️ 全面整理重构

This commit is contained in:
目棃
2024-12-13 16:15:01 +08:00
parent 86bfc80b57
commit 3ed6d503d4
229 changed files with 3105 additions and 4127 deletions

View File

@@ -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),

View File

@@ -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;