Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
enn-breadcrumb-vue3
Advanced tools
公共基础组件 面包屑组件 for Vue3
<template>
<div>
<Breadcrumb :breadcrumbs="breadcrumbs" />
</div>
</template>
<script>
import Breadcrumb from 'enn-breadcrumb-vue3';
export default {
components: {
Breadcrumb,
},
data() {
return {
breadcrumbs: [
{
name: 'test',
label: 'test',
},
],
};
},
}
</script>
参数 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
breadcrumbs | Array | [{ label: '首页' }] | 面包屑的数据 | |
home | string\Boolean\Object\Array | '/' | 首页跳转的 name,传 false 表示不需要 首页 | |
useHistory | boolean | false | 使用 history API 跳转首页的链接 |
参数 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
label | string | 是 | - | 面包屑项显示的文案 |
to | string | - | 路由跳转对象,同 vue-router 的 to | |
name | string | - | 路由跳转 name | |
href | string | - | 使用 history 进行路由跳转 | |
handler | Function | - | 自定义点击事件的处理函数 | |
query | Object | - | 路由跳转的参数 |
用于统一修改默认值,避免重复配置
事件名称 | 参数 | 说明 |
---|---|---|
setDefaultHome | home 参数的默认值 | 统一配置默认的 home |
setDefaultUseHistory | useHistory 参数的默认值 | 统一配置默认的 useHistory |
<Breadcrumb
:breadcrumbs="[
{
label: '列表',
name: 'list'
},
{
label: '详情',
name: 'detail',
query: { id: 10 }, // query 使用 this.$route.query 获取,或直接从 url 中的 search 获取。
},
{
label: '编辑',
}
]"
/>
<Breadcrumb :home="false" />
import { setDefaultHome } from 'enn-breadcrumb';
setDefaultHome(false);
<template>
<div>
<PageHeader :back="goBack" />
</div>
</template>
<script>
import { PageHeader } from 'enn-breadcrumb';
export default {
components: {
PageHeader,
},
methods: {
goBack() {
this.$router.go(-1)
}
}
}
</script>
参数 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
back | [Object, Function, String] | 是 | - | 点击回调 |
title | String | 否 | 返回 | 显示文字 |
FAQs
enn-breadcrumb-vue3
We found that enn-breadcrumb-vue3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.