Files
SingBox-Gopanel/frontend/admin/node_modules/element-plus/es/hooks/use-intermediate-render/index.mjs.map
CN-JS-HuiBai db7f1ba82f
Some checks failed
build / build (api, amd64, linux) (push) Failing after -51s
build / build (api, arm64, linux) (push) Failing after -52s
build / build (api.exe, amd64, windows) (push) Failing after -51s
使用VUE重构项目
2026-04-20 00:19:11 +08:00

1 line
1.9 KiB
Plaintext

{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/hooks/use-intermediate-render/index.ts"],"sourcesContent":["import { nextTick, unref, watch } from 'vue'\n\nimport type { Ref } from 'vue'\n\nexport type UseDelayedRenderProps = {\n indicator: Ref<boolean>\n intermediateIndicator: Ref<boolean>\n shouldSetIntermediate?: (step: 'show' | 'hide') => boolean\n beforeShow?: () => void\n beforeHide?: () => void\n afterShow?: () => void\n afterHide?: () => void\n}\n\nexport const useDelayedRender = ({\n indicator,\n intermediateIndicator,\n shouldSetIntermediate = () => true,\n beforeShow,\n afterShow,\n afterHide,\n beforeHide,\n}: UseDelayedRenderProps) => {\n watch(\n () => unref(indicator),\n (val) => {\n if (val) {\n beforeShow?.()\n nextTick(() => {\n if (!unref(indicator)) return\n if (shouldSetIntermediate('show')) {\n intermediateIndicator.value = true\n }\n })\n } else {\n beforeHide?.()\n nextTick(() => {\n if (unref(indicator)) return\n\n if (shouldSetIntermediate('hide')) {\n intermediateIndicator.value = false\n }\n })\n }\n }\n )\n\n // because we don't always set the value ourselves, so that we\n // simply watch the value's state, then invoke the corresponding hook.\n watch(\n () => intermediateIndicator.value,\n (val) => {\n if (val) {\n afterShow?.()\n } else {\n afterHide?.()\n }\n }\n )\n}\n"],"mappings":";;;AAcA,MAAa,oBAAoB,EAC/B,WACA,uBACA,8BAA8B,MAC9B,YACA,WACA,WACA,iBAC2B;AAC3B,aACQ,MAAM,UAAU,GACrB,QAAQ;AACP,MAAI,KAAK;AACP,iBAAc;AACd,kBAAe;AACb,QAAI,CAAC,MAAM,UAAU,CAAE;AACvB,QAAI,sBAAsB,OAAO,CAC/B,uBAAsB,QAAQ;KAEhC;SACG;AACL,iBAAc;AACd,kBAAe;AACb,QAAI,MAAM,UAAU,CAAE;AAEtB,QAAI,sBAAsB,OAAO,CAC/B,uBAAsB,QAAQ;KAEhC;;GAGP;AAID,aACQ,sBAAsB,QAC3B,QAAQ;AACP,MAAI,IACF,cAAa;MAEb,cAAa;GAGlB"}