23 lines
697 B
Vue
23 lines
697 B
Vue
<script setup lang="ts">
|
|
/**
|
|
* 互斥单选的 chip 按钮(按钮规范第 8 条):选中 accent 描边 + 浅底 + 加粗;
|
|
* dashed 为「自定义」扩展位。多选/触发器场景不要用它。
|
|
*/
|
|
defineProps<{ active?: boolean; dashed?: boolean }>()
|
|
</script>
|
|
|
|
<template>
|
|
<button
|
|
type="button"
|
|
class="rounded-md border px-3 py-1.5 text-xs transition-colors enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-60"
|
|
:class="[
|
|
active
|
|
? 'border-accent bg-accent/10 font-semibold text-accent'
|
|
: 'border-line bg-white text-ink-2 enabled:hover:border-ink-3',
|
|
dashed ? 'border-dashed' : '',
|
|
]"
|
|
>
|
|
<slot />
|
|
</button>
|
|
</template>
|