Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当执行多次 Hook::addMenuItem() 时,行为与文档描述不符 #613

Open
1 task
tnqzh123 opened this issue Jan 30, 2024 · 0 comments
Open
1 task

Comments

@tnqzh123
Copy link
Member

tnqzh123 commented Jan 30, 2024

Blessing Skin 版本

commit 866e182 @ dev branch

PHP 版本

8.1

出现问题时所使用的浏览器

Microsoft Edge

您正在使用的 Web Server

Nginx

您正在使用宝塔吗?

出现了什么问题?

插件的 bootstrap.php 中现有如下代码:

Hook::addMenuItem('explore', 3, [
    'title' => '^3',
    'link'  => '/somewhere',
    'icon'  => 'fa-3',
    'new-tab' => true,
]);

Hook::addMenuItem('explore', 2, [
    'title' => '^2',
    'link'  => '/somewhere',
    'icon'  => 'fa-2',
    'new-tab' => true,
]);

按照 Blessing Skin 插件开发文档中的描述,Hook::addMenuItem() 的第二个参数为菜单项的位置,则此时菜单项 ^2 应该在 ^3 的上方,但实际情况是 ^3 在 ^2 的上方,与文档描述不符。

image

若调换这两个方法的执行次序(即让 ^2 比 ^3 先添加),则菜单项顺序正常。

ref: https://bs-plugin.netlify.app/guide/bootstrap.html#%E6%B7%BB%E5%8A%A0%E8%8F%9C%E5%8D%95%E9%A1%B9

错误日志

No response

重现步骤

见上方问题描述

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant