docs: explain navigation, search and content components

This commit is contained in:
cieanyau committed 2026-11-06 00:37:46 +08:00
1 parent 2ff311005e
commit 179c6febf0
10 files changed
+34

No files matched your search

+4
View File
@@ -1,4 +1,5 @@
<script>
// 全局搜索同时展示实例与商品结果,负责输入防抖、过期请求失效和结果跳转。
import "~/assets/styles/GlobalSearch.BQqObidy.css";
import { toDisplayString } from "vue";
import { renderList } from "vue";
@@ -84,6 +85,7 @@ var w = {
W = null,
G = 0,
K = !1;
// 取消待执行的防抖任务并递增代次,已发出的旧请求也不能更新当前结果。
function q() {
(W !== null && clearTimeout(W),
(W = null),
@@ -93,6 +95,7 @@ var w = {
function J(e = !1) {
(q(), e && H.value?.focus(), (L.value = !1));
}
// 搜索使用去空白关键词;只有当前代次且组件未卸载时才写入结果或错误。
async function Y() {
if ((q(), K)) return;
let e = G,
@@ -117,6 +120,7 @@ var w = {
e === G && !K && (R.value = !1);
}
}
// 每次输入先关闭旧结果,停顿 300ms 后再查询,避免逐字符请求。
function X() {
(J(),
(B.value = null),