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-sidebar
Advanced tools
公共基础组件 侧边栏组件
<template>
<Sidebar
:top="52"
:menus="menus"
router
footerInfo="@foot"
/>
</template>
<script>
import Sidebar from "enn-sidebar";
export default {
components: {
Sidebar,
},
data() {
return {
menus: [
{
icon: 'el-icon-box',
title: 'test href 0',
href: 'https://www.baidu.com/0',
abbreviation: 'test',
},
{
icon: 'el-icon-s-custom',
index: '/user-manage',
title: '用户管理',
subs: [
{
index: 'index',
title: 'test href',
href: 'https://www.baidu.com'
},
{
index: '/user/list',
title: '账户管理',
subs: [
{
index: '/user/center',
title: '个人中心',
},
],
},
{
index: '/department/list',
title: '组织管理',
},
],
},
],
};
},
};
</script>
<style>
html,
body {
margin: 0;
padding: 0;
}
</style>
<el-aside width="200px">
<Sidebar :top="52" :menus="menus" router footerInfo="@foot" />
</el-aside>
<el-aside width="245px">
<Sidebar :top="52" :menus="doubleMenus" use-double router />
</el-aside>
参数 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
mode | string | hash | 路由的模式 hash or hsitory | |
router | boolean | false | 是否使用 vue-router 的模式,启用该模式会在激活导航时以 index 作为 path 进行路由跳转 | |
menus | Array | 是 | 渲染侧边栏的数据 | |
footerInfo | string | 底部信息文案 | ||
useDouble | boolean | false | 是否使用双层侧边栏模式 | |
showTitle | boolean | false | 双层侧边栏模式下 hover 是否展示 title | |
isQiankun | boolean | false | 是否是微前端使用的侧边栏 path 为微应用 activeRule + index | |
top | number | 0 | 距离顶部的高度 top | |
routePropUrls | Object | 设置路由传参的地址与其侧边栏激活状态的映射地址,保证侧边栏不会失去焦点。 |
参数 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
icon | string | icon 的类名 | ||
iconUrl | string | icon 位置图片的地址 | ||
index | string | 唯一标志,路由跳转的地址,以及激活状态的标志。 | ||
title | string | 标题,在双层侧边栏的首层中会作为 hover 的提示 | ||
abbreviation | string | 标题简称,用于渲染双层侧边栏首层的标题,最好是两个字 | ||
subs | Array | 子菜单 | ||
activeRule | string | 微应用的基础路径 activeRule | ||
mode | string | hash | 微应用的路由模式 hash or history | |
key | string | 使用 href 或 handler 且没有 index 时为必填项 | ||
href | string | window.open 的跳转地址,需要时完整的路径 | ||
_self | boolean | 当为 true 时,href 改为使用 window.location.href = href; 进行跳转 | ||
handler | Function | 项点击事件的回调函数,参数为当前项的数据,返回 true 时,阻止 default-active 状态改变 | ||
disabled | boolean | 是否禁用当前项 |
FAQs
公共基础组件 侧边栏组件
The npm package enn-sidebar receives a total of 1 weekly downloads. As such, enn-sidebar popularity was classified as not popular.
We found that enn-sidebar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.