包含以下组件:
Button
- 单个按钮名称 | 类型 | 默认值 | 描述 |
---|---|---|---|
clear | boolean | undefined | 使按钮以清晰风格(无填充颜色)。覆盖 |
clearIos | boolean | false | 使按钮以清晰风格(无填充颜色)在 iOS 主题中 |
clearMaterial | boolean | false | 使按钮以清晰风格(无填充颜色)在 Material 主题中 |
colors | object | 包含 Tailwind CSS 颜色类对象的属性 | |
colors.activeBgIos | string | 'active:bg-primary' | |
colors.activeBgMaterial | string | '' | |
colors.disabledBg | string | 'bg-black bg-opacity-10 dark:bg-white dark:bg-opacity-10' | |
colors.disabledBorder | string | 'border-black border-opacity-10 dark:border-white dark:border-opacity-10' | |
colors.disabledText | string | 'text-black text-opacity-30 dark:text-white dark:text-opacity-30' | |
colors.fillActiveBgIos | string | 'active:bg-ios-primary-shade' | |
colors.fillActiveBgMaterial | string | '' | |
colors.fillBgIos | string | 'bg-primary' | |
colors.fillBgMaterial | string | 'bg-md-light-primary dark:bg-md-dark-primary' | |
colors.fillTextIos | string | 'text-white' | |
colors.fillTextMaterial | string | 'text-md-light-on-primary dark:text-md-dark-on-primary' | |
colors.fillTouchRipple | string | 'touch-ripple-white dark:touch-ripple-primary' | |
colors.outlineBorderIos | string | 'border-primary' | |
colors.outlineBorderMaterial | string | 'border-md-light-outline dark:border-md-dark-outline' | |
colors.textIos | string | 'text-primary' | |
colors.textMaterial | string | 'text-md-light-primary dark:text-md-dark-primary' | |
colors.tonalBgIos | string | 'bg-primary' | |
colors.tonalBgMaterial | string | 'bg-md-light-secondary-container dark:bg-md-dark-secondary-container' | |
colors.tonalTextIos | string | 'text-primary' | |
colors.tonalTextMaterial | string | 'text-md-light-on-secondary-container dark:text-md-dark-on-secondary-container' | |
colors.touchRipple | string | 'touch-ripple-primary' | |
component | string | 'button' | 组件的 HTML 元素 |
disabled | boolean | false | 使按钮失效 |
href | string | 链接的 | |
inline | boolean | false | 使按钮为内联(例如 |
large | boolean | undefined | 使按钮变大。覆盖 |
largeIos | boolean | false | 使按钮在 iOS 主题中变大 |
largeMaterial | boolean | false | 使按钮在 Material 主题中变大 |
outline | boolean | undefined | 使按钮为轮廓。覆盖 |
outlineIos | boolean | false | 使按钮在 iOS 主题中为轮廓 |
outlineMaterial | boolean | false | 使按钮在 Material 主题中为轮廓 |
raised | boolean | undefined | 使按钮凸起(带有阴影)。覆盖 |
raisedIos | boolean | false | 使按钮在 iOS 主题中凸起(带有阴影) |
raisedMaterial | boolean | false | 使按钮在 Material 主题中凸起(带有阴影) |
rounded | boolean | undefined | 使按钮变圆。覆盖 |
roundedIos | boolean | false | 使按钮在 iOS 主题中变圆 |
roundedMaterial | boolean | false | 使按钮在 Material 主题中变圆 |
segmented | boolean | false | 渲染分段按钮,与 |
segmentedActive | boolean | false | 渲染分段激活按钮,与 |
segmentedStrong | boolean | false | 渲染分段强按钮,与 |
small | boolean | undefined | 使按钮变小。覆盖 |
smallIos | boolean | false | 使按钮在 iOS 主题中变小 |
smallMaterial | boolean | false | 使按钮在 Material 主题中变小 |
tonal | boolean | undefined | 使按钮以色调风格(带有半透明填充颜色)。覆盖 |
tonalIos | boolean | false | 使按钮以色调风格(带有半透明填充颜色)在 iOS 主题中 |
tonalMaterial | boolean | false | 使按钮以色调风格(带有半透明填充颜色)在 Material 主题中 |
touchRipple | boolean | true | 在 Material 主题中启用触控波纹效果 |
<template><k-page><k-navbar title="Buttons" /><k-block-title>Default Buttons</k-block-title><k-block strong outline-ios class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><k-button>Button</k-button><k-button class="k-color-brand-red"> Button </k-button><k-button>Button</k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button outline>Outline</k-button><k-button class="k-color-brand-red" outline> Outline </k-button><k-button outline>Outline</k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button clear>Clear</k-button><k-button class="k-color-brand-red" clear> Clear </k-button><k-button clear>Clear</k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button tonal>Tonal</k-button><k-button class="k-color-brand-red" tonal> Tonal </k-button><k-button tonal>Tonal</k-button></div></k-block><k-block-title>Rounded Buttons</k-block-title><k-block strong outline-ios class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><k-button rounded>Button</k-button><k-button rounded class="k-color-brand-green">Button</k-button><k-button rounded>Button</k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button rounded outline> Outline </k-button><k-button rounded outline class="k-color-brand-green">Outline</k-button><k-button rounded outline> Outline </k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button rounded clear> Clear </k-button><k-button rounded clear class="k-color-brand-green"> Clear </k-button><k-button rounded clear> Clear </k-button></div></k-block><k-block-title>Large Buttons</k-block-title><k-block strong outline-ios class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><k-button large>Button</k-button><k-button large class="k-color-brand-yellow">Button</k-button><k-button large rounded> Button </k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button large outline> Outline </k-button><k-button large outline class="k-color-brand-yellow">Outline</k-button><k-button large rounded outline> Outline </k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button large clear> Clear </k-button><k-button large clear class="k-color-brand-yellow"> Clear </k-button><k-button large rounded clear> Clear </k-button></div></k-block><k-block-title>Small Buttons</k-block-title><k-block strong outline-ios class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><k-button small>Button</k-button><k-button small>Button</k-button><k-button small rounded> Button </k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button small outline> Outline </k-button><k-button small outline> Outline </k-button><k-button small rounded outline> Outline </k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button small clear> Clear </k-button><k-button small clear> Clear </k-button><k-button small rounded clear> Clear </k-button></div></k-block><k-block-title>Raised Buttons</k-block-title><k-block strong outline-ios class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><k-button raised>Button</k-button><k-button raised>Button</k-button><k-button raised rounded> Button </k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button raised outline> Outline </k-button><k-button raised outline> Outline </k-button><k-button raised rounded outline> Outline </k-button></div><div class="grid grid-cols-3 gap-x-4"><k-button raised clear> Clear </k-button><k-button raised clear> Clear </k-button><k-button raised rounded clear> Clear </k-button></div></k-block><k-block-title>Disabled Buttons</k-block-title><k-block strong outline-ios class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><k-button disabled>Button</k-button><k-button disabled outline>Outline</k-button><k-button disabled clear>Clear</k-button></div></k-block></k-page></template><script>import {kPage,kNavbar,kNavbarBackLink,kButton,kBlock,kBlockTitle,} from 'konsta/vue';export default {components: {kPage,kNavbar,kNavbarBackLink,kButton,kBlock,kBlockTitle,},};</script>