Files
2026-09-21 15:32:12 +08:00

48 lines
977 B
Vue

<template>
<div class="demo">
<div v-for="item in numberList" :key="item.value" class="row">
<contact-number :value="item.value" underline />
<span class="note" v-text="item.note" />
</div>
<div class="row">
<contact-number value="13800138000" separator="-">
<template #icon>
<icon name="mail" :scale="1.2" />
</template>
</contact-number>
<span class="note" v-text="'自定义前置图标 + 短横线分隔'" />
</div>
</div>
</template>
<script lang="ts" setup>
import { ContactNumber, Icon } from "timi-web";
const numberList = [
{ value: "13800138000", note: "手机号" },
{ value: "4008001234", note: "客服热线" },
{ value: "+8613800138000", note: "带国际区号" }
];
</script>
<style lang="less" scoped>
.demo {
.row {
display: flex;
gap: 1rem;
align-items: center;
margin-bottom: .75rem;
&:last-child {
margin-bottom: 0;
}
}
.note {
font-size: .75rem;
color: var(--vp-c-text-2);
}
}
</style>