128 lines
3.4 KiB
Vue
128 lines
3.4 KiB
Vue
<script setup lang="ts">
|
||
import { defineAsyncComponent } from "vue";
|
||
|
||
// Keep regression URLs stable; load only the selected harness.
|
||
const labs = [
|
||
{
|
||
key: "field-otp",
|
||
title: "字段与验证码",
|
||
component: defineAsyncComponent(
|
||
() => import("../../../tests/fixtures/field-otp.vue"),
|
||
),
|
||
},
|
||
{
|
||
key: "link-focus",
|
||
title: "链接与日期焦点",
|
||
component: defineAsyncComponent(
|
||
() => import("../../../tests/fixtures/link-focus.vue"),
|
||
),
|
||
},
|
||
{
|
||
key: "button-group-dropdown",
|
||
title: "按钮组与下拉根属性",
|
||
component: defineAsyncComponent(
|
||
() => import("../../../tests/fixtures/button-group-dropdown.vue"),
|
||
),
|
||
},
|
||
{
|
||
key: "handbook",
|
||
title: "Handbook 实现规范",
|
||
component: defineAsyncComponent(() => import("./HandbookLab.vue")),
|
||
},
|
||
{
|
||
key: "color-field-protocol",
|
||
title: "颜色字段与 Picker",
|
||
component: defineAsyncComponent(
|
||
() => import("./ColorFieldProtocolLab.vue"),
|
||
),
|
||
},
|
||
{
|
||
key: "color-slider-foundation",
|
||
title: "颜色轨道",
|
||
component: defineAsyncComponent(
|
||
() => import("./ColorSliderFoundationLab.vue"),
|
||
),
|
||
},
|
||
{
|
||
key: "color-input-foundation",
|
||
title: "颜色输入",
|
||
component: defineAsyncComponent(
|
||
() => import("./ColorInputFoundationLab.vue"),
|
||
),
|
||
},
|
||
{
|
||
key: "color-foundation",
|
||
title: "颜色模型与 Area",
|
||
component: defineAsyncComponent(() => import("./ColorFoundationLab.vue")),
|
||
},
|
||
{
|
||
key: "range-calendar-foundation",
|
||
title: "范围日历",
|
||
component: defineAsyncComponent(
|
||
() => import("./RangeCalendarFoundationLab.vue"),
|
||
),
|
||
},
|
||
{
|
||
key: "select-lifecycle",
|
||
title: "Select 生命周期",
|
||
component: defineAsyncComponent(
|
||
() => import("../../../packages/vue/tests/fixtures/SelectLifecycle.vue"),
|
||
),
|
||
},
|
||
{
|
||
key: "scroll-tabs",
|
||
title: "滚动与 Tabs",
|
||
component: defineAsyncComponent(() => import("./ScrollTabsLab.vue")),
|
||
},
|
||
{
|
||
key: "overlay-animation",
|
||
title: "弹层动画",
|
||
component: defineAsyncComponent(() => import("./OverlayAnimationLab.vue")),
|
||
},
|
||
{
|
||
key: "date-picker-overlay",
|
||
title: "DatePicker 嵌套弹层",
|
||
component: defineAsyncComponent(() => import("./DatePickerLab.vue")),
|
||
},
|
||
{
|
||
key: "date-range-picker-overlay",
|
||
title: "DateRangePicker 嵌套弹层",
|
||
component: defineAsyncComponent(() => import("./DateRangePickerLab.vue")),
|
||
},
|
||
{
|
||
key: "overlay-components",
|
||
title: "弹层公共组合",
|
||
component: defineAsyncComponent(() => import("./OverlayComponentsLab.vue")),
|
||
},
|
||
{
|
||
key: "overlay-lab",
|
||
title: "弹层基础协议",
|
||
component: defineAsyncComponent(() => import("./OverlayLab.vue")),
|
||
},
|
||
{
|
||
key: "filter-virtual",
|
||
title: "集合过滤与虚拟化",
|
||
component: defineAsyncComponent(() => import("./FilterVirtualLab.vue")),
|
||
},
|
||
];
|
||
const query = new URLSearchParams(
|
||
typeof window === "undefined" ? "" : window.location.search,
|
||
);
|
||
const active = labs.find((lab) => query.has(lab.key));
|
||
</script>
|
||
|
||
<template>
|
||
<component :is="active.component" v-if="active" />
|
||
<main v-else class="lab-index">
|
||
<h1>交互回归入口</h1>
|
||
<p>组件使用示例请看文档站;这里保留需要真实浏览器验证的专项场景。</p>
|
||
<nav aria-label="回归场景">
|
||
<ul>
|
||
<li v-for="lab in labs" :key="lab.key">
|
||
<a :href="`?${lab.key}`">{{ lab.title }}</a>
|
||
</li>
|
||
</ul>
|
||
</nav>
|
||
</main>
|
||
</template>
|