chore: reduce migration history and streamline validation workflow
This commit is contained in:
+87
-194
@@ -1,198 +1,91 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import ColorFieldProtocolLab from "./ColorFieldProtocolLab.vue";
|
||||
const colorFieldProtocol =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("color-field-protocol");
|
||||
import ColorSliderFoundationLab from "./ColorSliderFoundationLab.vue";
|
||||
const colorSliderFoundation =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("color-slider-foundation");
|
||||
import ColorInputFoundationLab from "./ColorInputFoundationLab.vue";
|
||||
const colorInputFoundation =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("color-input-foundation");
|
||||
import ColorFoundationLab from "./ColorFoundationLab.vue";
|
||||
const colorFoundation =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("color-foundation");
|
||||
import RangeCalendarFoundationLab from "./RangeCalendarFoundationLab.vue";
|
||||
const rangeFoundation =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("range-calendar-foundation");
|
||||
import SelectLifecycle from "../../../packages/vue/tests/fixtures/SelectLifecycle.vue";
|
||||
const selectLifecycle =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("select-lifecycle");
|
||||
import ScrollTabsLab from "./ScrollTabsLab.vue";
|
||||
const scrollTabsLab =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("scroll-tabs");
|
||||
import OverlayAnimationLab from "./OverlayAnimationLab.vue";
|
||||
const animationLab =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("overlay-animation");
|
||||
import OverlayLab from "./OverlayLab.vue";
|
||||
import FilterVirtualLab from "./FilterVirtualLab.vue";
|
||||
const filterVirtualLab =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("filter-virtual");
|
||||
import OverlayComponentsLab from "./OverlayComponentsLab.vue";
|
||||
const componentsLab =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("overlay-components");
|
||||
const overlayLab =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).has("overlay-lab");
|
||||
import { Button, Card, Input, Switch } from "@heroui-vue/components";
|
||||
const dark = ref(false),
|
||||
notifications = ref(true),
|
||||
name = ref("设计团队"),
|
||||
saved = ref(false),
|
||||
count = ref(0);
|
||||
function save() {
|
||||
saved.value = true;
|
||||
}
|
||||
import { defineAsyncComponent } from "vue";
|
||||
|
||||
// Keep regression URLs stable; load only the selected harness.
|
||||
const labs = [
|
||||
{
|
||||
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: "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>
|
||||
<ColorFieldProtocolLab v-if="colorFieldProtocol" />
|
||||
<ColorSliderFoundationLab v-else-if="colorSliderFoundation" />
|
||||
<ColorInputFoundationLab v-else-if="colorInputFoundation" />
|
||||
<ColorFoundationLab v-else-if="colorFoundation" />
|
||||
<RangeCalendarFoundationLab v-else-if="rangeFoundation" />
|
||||
<SelectLifecycle v-else-if="selectLifecycle" />
|
||||
<ScrollTabsLab v-else-if="scrollTabsLab" />
|
||||
<OverlayAnimationLab v-else-if="animationLab" />
|
||||
<OverlayComponentsLab v-else-if="componentsLab" />
|
||||
<OverlayLab v-else-if="overlayLab" />
|
||||
<FilterVirtualLab v-else-if="filterVirtualLab" />
|
||||
<div v-else class="lab" :data-theme="dark ? 'dark' : 'light'">
|
||||
<header>
|
||||
<a class="wordmark" href="#">
|
||||
hero
|
||||
<span>ui</span>
|
||||
<small>Vue</small>
|
||||
</a>
|
||||
<nav>
|
||||
<a href="#components">组件预览</a>
|
||||
<a href="#start">开始使用</a>
|
||||
</nav>
|
||||
<label class="theme">
|
||||
深色模式
|
||||
<Switch v-model:checked="dark" aria-label="深色模式" />
|
||||
</label>
|
||||
</header>
|
||||
<main>
|
||||
<section class="intro">
|
||||
<p class="release">Vue 3 组件库 · 开发预览</p>
|
||||
<h1>
|
||||
熟悉的设计,
|
||||
<br />
|
||||
自然的 Vue 体验。
|
||||
</h1>
|
||||
<p class="lead">
|
||||
从一颗按钮开始,让每一个细节都有章可循。
|
||||
<br />
|
||||
在这里试试第一批组件。
|
||||
</p>
|
||||
<a class="text-link" href="#components">探索组件 ↓</a>
|
||||
</section>
|
||||
<section id="components" class="workbench">
|
||||
<div class="section-title">
|
||||
<h2>组件实验室</h2>
|
||||
<span>4 个组件 · 起步阶段</span>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<Card class="button-demo">
|
||||
<div class="demo-title">
|
||||
<h3>Button</h3>
|
||||
<span>动作与反馈</span>
|
||||
</div>
|
||||
<div class="samples">
|
||||
<Button @click="count++">
|
||||
点击试试
|
||||
<span aria-live="polite">{{ count }}</span>
|
||||
</Button>
|
||||
<Button variant="secondary">次要操作</Button>
|
||||
<Button variant="outline">描边按钮</Button>
|
||||
<Button variant="ghost">轻量操作</Button>
|
||||
<Button variant="danger">危险操作</Button>
|
||||
<Button disabled>不可用</Button>
|
||||
</div>
|
||||
<p class="caption">圆角、尺寸、状态,保持一致的触感。</p>
|
||||
</Card>
|
||||
<Card>
|
||||
<div class="demo-title">
|
||||
<h3>工作区设置</h3>
|
||||
<span>Input + Switch</span>
|
||||
</div>
|
||||
<form @submit.prevent="save">
|
||||
<label class="field">
|
||||
工作区名称
|
||||
<Input
|
||||
v-model="name"
|
||||
name="workspace"
|
||||
required
|
||||
@input="saved = false"
|
||||
/>
|
||||
</label>
|
||||
<div class="setting">
|
||||
<div>
|
||||
<label for="notifications">活动通知</label>
|
||||
<p>接收工作区的重要更新</p>
|
||||
</div>
|
||||
<Switch
|
||||
id="notifications"
|
||||
v-model:checked="notifications"
|
||||
name="notifications"
|
||||
/>
|
||||
</div>
|
||||
<Button type="submit" full-width>保存设置</Button>
|
||||
<p class="feedback" role="status">
|
||||
{{
|
||||
saved
|
||||
? `已保存「${name}」的设置`
|
||||
: "修改后点击保存,试试双向绑定。"
|
||||
}}
|
||||
</p>
|
||||
</form>
|
||||
</Card>
|
||||
<Card variant="secondary" class="card-demo">
|
||||
<div class="demo-title">
|
||||
<h3>Card</h3>
|
||||
<span>内容的容器</span>
|
||||
</div>
|
||||
<div class="swatches">
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
</div>
|
||||
<h4>
|
||||
为你的下一次创作
|
||||
<br />
|
||||
留一块画布。
|
||||
</h4>
|
||||
<p>主题变量与组件样式独立维护,让定制从容一点。</p>
|
||||
<Button variant="outline" @click="dark = !dark">切换主题</Button>
|
||||
</Card>
|
||||
</div>
|
||||
</section>
|
||||
<section id="start" class="start">
|
||||
<div>
|
||||
<h2>从这里开始</h2>
|
||||
<p>本地开发预览,组件仍在持续完善。</p>
|
||||
</div>
|
||||
<code>
|
||||
pnpm install
|
||||
<br />
|
||||
pnpm dev
|
||||
</code>
|
||||
</section>
|
||||
<footer>
|
||||
<span>HeroUI Vue · 独立社区实现</span>
|
||||
<span>以 HeroUI v3 为设计参考</span>
|
||||
</footer>
|
||||
</main>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user