feat: add Checkbox and Radio field families
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
import { IconCode, IconCopy } from "@tabler/icons-vue";
|
||||
import { computed, ref, watch, onBeforeUnmount, useId } from "vue";
|
||||
import { highlights } from "virtual:docs-data";
|
||||
const props = defineProps<{ name: string }>();
|
||||
const props = defineProps<{
|
||||
name: string;
|
||||
align?: "center" | "start" | "end";
|
||||
isBgSolid?: boolean;
|
||||
}>();
|
||||
const demos = import.meta.glob("../../demos/*.vue", {
|
||||
eager: true,
|
||||
import: "default",
|
||||
@@ -53,7 +57,18 @@ onBeforeUnmount(() => clearTimeout(timer));
|
||||
</script>
|
||||
<template>
|
||||
<div class="component-preview-container" :data-name="name">
|
||||
<div class="preview not-prose">
|
||||
<div
|
||||
class="preview not-prose"
|
||||
:style="{
|
||||
alignItems:
|
||||
align === 'start'
|
||||
? 'flex-start'
|
||||
: align === 'end'
|
||||
? 'flex-end'
|
||||
: undefined,
|
||||
background: isBgSolid ? 'var(--background)' : undefined,
|
||||
}"
|
||||
>
|
||||
<div class="demo-row">
|
||||
<component :is="component" v-if="component" />
|
||||
<p v-else role="alert">示例不存在:{{ name }}</p>
|
||||
|
||||
@@ -51,6 +51,8 @@ const groups = [
|
||||
{ title: "Badge 徽章", url: "/components/badge" },
|
||||
{ title: "Button 按钮", url: "/components/button" },
|
||||
{ title: "Card 卡片", url: "/components/card" },
|
||||
{ title: "Checkbox 复选框", url: "/components/checkbox" },
|
||||
{ title: "CheckboxGroup 复选框组", url: "/components/checkbox-group" },
|
||||
{ title: "Chip 标签", url: "/components/chip" },
|
||||
{ title: "CloseButton 关闭按钮", url: "/components/close-button" },
|
||||
{ title: "Description 描述", url: "/components/description" },
|
||||
@@ -61,6 +63,7 @@ const groups = [
|
||||
{ title: "Kbd 键盘按键", url: "/components/kbd" },
|
||||
{ title: "Label 标签", url: "/components/label" },
|
||||
{ title: "Link 链接", url: "/components/link" },
|
||||
{ title: "RadioGroup 单选框组", url: "/components/radio-group" },
|
||||
{ title: "SearchField 搜索框", url: "/components/search-field" },
|
||||
{ title: "Separator 分隔符", url: "/components/separator" },
|
||||
{ title: "Skeleton 骨架屏", url: "/components/skeleton" },
|
||||
|
||||
Reference in New Issue
Block a user