docs: complete handbook and prepare component verification tasks
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
import { usePreferredDark } from "@vueuse/core";
|
||||
import { Button, Card, Input } from "@heroui-vue/components";
|
||||
const mode = ref("system");
|
||||
const systemDark = usePreferredDark();
|
||||
const resolved = computed(() =>
|
||||
mode.value === "system" ? (systemDark.value ? "dark" : "light") : mode.value,
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<div class="mode-demo">
|
||||
<label>
|
||||
外观
|
||||
<select v-model="mode">
|
||||
<option value="light">浅色</option>
|
||||
<option value="dark">深色</option>
|
||||
<option value="system">跟随系统</option>
|
||||
</select>
|
||||
</label>
|
||||
<section :class="resolved" class="mode-preview">
|
||||
<Card>
|
||||
<strong>主题预览</strong>
|
||||
<p>当前选择:{{ mode }};解析为:{{ resolved }}。</p>
|
||||
</Card>
|
||||
<Input aria-label="深色模式预览" placeholder="输入内容" />
|
||||
<Button>继续</Button>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.mode-demo {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
}
|
||||
.mode-preview {
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
padding: 20px;
|
||||
border-radius: 16px;
|
||||
background: var(--background);
|
||||
color: var(--foreground);
|
||||
}
|
||||
select {
|
||||
padding: 4px 8px;
|
||||
background: var(--field-background);
|
||||
color: var(--field-foreground);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user