Files
timi-tdesign-mobile/docs/demos/space/basic.vue
T
2026-09-21 16:05:14 +08:00

69 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="demo">
<section class="block">
<h4 v-text="'水平(默认 medium)'" />
<space>
<div v-for="item in 3" :key="item" class="box" v-text="`项 ${item}`" />
</space>
</section>
<section class="block">
<h4 v-text="'预设尺寸 small / large'" />
<space size="small">
<div v-for="item in 3" :key="item" class="box" v-text="`项 ${item}`" />
</space>
<space size="large">
<div v-for="item in 3" :key="item" class="box" v-text="`项 ${item}`" />
</space>
</section>
<section class="block">
<h4 v-text="'垂直排列'" />
<space direction="vertical">
<div v-for="item in 3" :key="item" class="box" v-text="`项 ${item}`" />
</space>
</section>
<section class="block">
<h4 v-text="'分隔符'" />
<space separator="|">
<span v-for="item in 3" :key="item" v-text="`项 ${item}`" />
</space>
</section>
</div>
</template>
<script lang="ts" setup>
import { Space } from "timi-tdesign-mobile";
</script>
<style lang="less" scoped>
.demo {
.block {
margin-bottom: 1.25rem;
&:last-child {
margin-bottom: 0;
}
}
h4 {
margin: 0 0 .5rem;
font-size: .8125rem;
}
.box {
padding: .375rem .625rem;
font-size: .75rem;
border-radius: .375rem;
color: var(--vp-c-brand-1);
background: var(--vp-c-default-soft);
}
span {
font-size: .75rem;
color: var(--vp-c-text-2);
}
}
</style>