
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
无限层级下拉菜单
/** 菜单类型 */
export type Menu = Item[]
/** 菜单项 */
export type Item = {
/** 菜单文本 */
text: string,
/** 子菜单列表 */
subMenu?: Menu,
/** 是否勾选 */
isChecked?: boolean,
/** 是否禁用 */
disabled?: boolean,
/** 点击自动关闭菜单,只对无子菜单的菜单项有效,默认 `true` */
autoClose?: boolean,
/** 自动勾选/取消勾选,只对无子菜单的菜单项有效,默认 `false` */
autoCheck?: boolean,
/** 是否限定单选,只对无子菜单的菜单项有效,默认 `false` */
oneCheck?: boolean,
/** 单击事件 */
onclick?: ((
/** 当前菜单项配置 */
itemConfig: Item,
/** 鼠标事件对象 */
event: MouseEvent
) => void) | (() => void)
}
ApeeMenu通过 npm 安装
npm install apee-menu
通过 script 标签引入
<!-- 未压缩版本 -->
<script src="https://cdn.jsdelivr.net/npm/apee-menu/dist/apee-menu.js"></script>
<!-- 压缩版本 -->
<script src="https://cdn.jsdelivr.net/npm/apee-menu/dist/apee-menu.min.js"></script>
导入 ApeeMenu
import { ApeeMenu } from 'apee-menu'
const { ApeeMenu } = require('apee-menu')
使用 ApeeMenu
const apeeMenu = new ApeeMenu()
const menuConfig = [
{
text: '文件',
subMenu: [
{ text: '新建文本文件' },
{ text: '新建文件' },
{ text: '新建窗口' },
{
text: '打开文件',
subMenu: [
{ text: '新建文本文件' },
{ text: '新建文件' },
{ text: '新建窗口' },
{ text: '打开文件' },
]
},
]
}
]
apeeMenu.setMenuConfig(menuConfig)
apeeMenu.setLocation(100, 50)
document.querySelector('button').onclick = function () {
apeeMenu.show()
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/apee-menu/css/style.css">
请为需要设置点击展开菜单事件的元素增加 apee-menu 类。
<button class="apee-menu"></button>
npm installnpm run buildFAQs
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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.