如何配置menu菜单某一个页面target="_blank"新窗口打开 #7
Answered
by
stevenjoezhang
imzhangmengxin
asked this question in
Q&A
-
Please follow this Issue template to provide relevant information, such as source code repositories, blog links, and screenshots, which will help us investigate. Issue Checklist
Expected behavior希望,点击菜单某个页面,比如admin后可以跳转新窗口打开 Hexo Configurationtheme: next NexT Configurationmenu:
home: / || fa fa-home
tags: /tags/ || fa fa-tags
categories: /categories/ || fa fa-th
archives: /archives/ || fa fa-archive
admin: /admin/ || fa fa-laptop-code Other Information |
Beta Was this translation helpful? Give feedback.
Answered by
stevenjoezhang
May 14, 2020
Replies: 1 comment
-
有两种比较简单的方法
document.querySelector('.menu-item-admin a').target = '_blank';
if (path === '/admin/') attrs.target = '_blank'; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
stevenjoezhang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
有两种比较简单的方法
在这一行代码
hexo-theme-next/scripts/helpers/next-url.js
Line 60 in cbcd3f0
之前加上一行