🔥 认识我们的新项目 t0ggles - 您终极的项目管理工具! 🔥

面包屑 Vue 组件

面包屑允许用户跟踪和保持对其在应用程序或网站中的位置的意识。 它们应用于具有层次结构排列页面的大型网站和应用程序。

包含以下组件

  • 面包屑
  • BreadcrumbsItem
  • BreadcrumbsSeparator
  • BreadcrumbsCollapsed
名称类型默认值描述
组件字符串'div'

组件的 HTML 元素

fontSizeIos字符串'text-[17px]'

iOS 主题中的字体大小

fontSizeMaterial字符串'text-[14px]'

Material 主题中的字体大小

名称类型默认值描述
活动布尔值false

将面包屑项标记为活动/当前(通常是面包屑中的最后一项)

颜色对象

具有 Tailwind CSS 颜色类的对象

colors.bgIos字符串''
colors.bgMaterial字符串'bg-md-light-secondary-container dark:bg-md-dark-secondary-container'
colors.textActiveIos字符串'text-black dark:text-white'
colors.textActiveMaterial字符串'text-md-light-on-secondary-container dark:text-md-dark-on-secondary-container'
colors.textIos字符串'text-black text-opacity-55 dark:text-white dark:text-opacity-55'
colors.textMaterial字符串'text-md-light-on-secondary-container dark:text-md-dark-on-secondary-container'
组件字符串'div'

组件的 HTML 元素

名称类型默认值描述
颜色对象

具有 Tailwind CSS 颜色类的对象

colors.bgIos字符串'bg-black bg-opacity-15 dark:bg-white dark:bg-opacity-15'
colors.bgMaterial字符串'bg-md-light-secondary-container dark:bg-md-dark-secondary-container'
colors.dotBgIos字符串'bg-black dark:bg-white'
colors.dotBgMaterial字符串'bg-md-light-primary dark:bg-md-dark-primary'
组件字符串'div'

组件的 HTML 元素

示例

Breadcrumbs.vue
<template>
<k-page>
<k-navbar title="Breadcrumbs" />
<k-block strong inset>
<p>
Breadcrumbs allow users to keep track and maintain awareness of their
locations within the app or website. They should be used for large sites
and apps with hierarchically arranged pages.
</p>
</k-block>
<k-block-title>Basic</k-block-title>
<k-block strong-ios outline-ios>
<k-breadcrumbs>
<k-breadcrumbs-item>
<k-link>Home</k-link>
</k-breadcrumbs-item>
<k-breadcrumbs-separator />
<k-breadcrumbs-item>
<k-link>Catalog</k-link>
</k-breadcrumbs-item>
<k-breadcrumbs-separator />
<k-breadcrumbs-item active>Phones</k-breadcrumbs-item>
</k-breadcrumbs>
</k-block>
<k-block-title>Scrollable</k-block-title>
<k-block-header
>Breadcrumbs will be scrollable if they don't fit the
screen</k-block-header
>
<k-block strong-ios outline-ios>
<k-breadcrumbs>
<k-breadcrumbs-item>
<k-link>Home</k-link>
</k-breadcrumbs-item>
<k-breadcrumbs-separator />
<k-breadcrumbs-item>
<k-link>Catalog</k-link>
</k-breadcrumbs-item>
<k-breadcrumbs-separator />
<k-breadcrumbs-item>
<k-link>Phones</k-link>
</k-breadcrumbs-item>
<k-breadcrumbs-separator />
<k-breadcrumbs-item>
<k-link>Apple</k-link>
</k-breadcrumbs-item>
<k-breadcrumbs-separator />
<k-breadcrumbs-item active>iPhone 12</k-breadcrumbs-item>
</k-breadcrumbs>
</k-block>
<k-block-title>Collapsed</k-block-title>
<k-block strong-ios outline-ios>
<k-breadcrumbs>
<k-breadcrumbs-item>
<k-link>Home</k-link>
</k-breadcrumbs-item>
<k-breadcrumbs-separator />
<k-breadcrumbs-collapsed
ref="popoverTargetRef"
@click="() => (popoverOpened = true)"
/>
<k-breadcrumbs-separator />
<k-breadcrumbs-item active>iPhone 12</k-breadcrumbs-item>
</k-breadcrumbs>
</k-block>
<k-popover
:opened="popoverOpened"
:target="popoverTargetRef"
style="width: 120px"
@backdropclick="() => (popoverOpened = false)"
>
<k-list nested>
<k-list-item
link
title="Catalog"
@click="() => (popoverOpened = false)"
/>
<k-list-item
link
title="Phones"
@click="() => (popoverOpened = false)"
/>
<k-list-item
link
title="Apple"
@click="() => (popoverOpened = false)"
/>
</k-list>
</k-popover>
</k-page>
</template>
<script>
import { ref } from 'vue';
import {
kPage,
kNavbar,
kNavbarBackLink,
kLink,
kBlock,
kBlockTitle,
kBlockHeader,
kBreadcrumbs,
kBreadcrumbsItem,
kBreadcrumbsSeparator,
kBreadcrumbsCollapsed,
kPopover,
kList,
kListItem,
} from 'konsta/vue';
export default {
components: {
kPage,
kNavbar,
kNavbarBackLink,
kLink,
kBlock,
kBlockTitle,
kBlockHeader,
kBreadcrumbs,
kBreadcrumbsItem,
kBreadcrumbsSeparator,
kBreadcrumbsCollapsed,
kPopover,
kList,
kListItem,
},
setup() {
const popoverOpened = ref(false);
const popoverTargetRef = ref(null);
return {
popoverOpened,
popoverTargetRef,
};
},
};
</script>
代码许可证 MIT.
2022 © Konsta UI by nolimits4web.