The sidebar secondary menu can jump to the specified URL by setting the href attribute. The specific steps are as follows: Add the href attribute to the HTML of the secondary menu item. The value of href can be an absolute URL or a relative URL. For dynamic sidebars, the jump to the secondary menu needs to be handled in the layui.element.on() function.
layui sidebar secondary menu jump
In the layui framework, the sidebar secondary menu Menu jump can be achieved by setting the href
attribute.
Add the href
attribute
In the HTML structure of the secondary menu item, add the href
attribute and specify the jump Transferred URL:
<code class="html"><li class="layui-nav-item"> <a href="/url/to/jump"> <i class="layui-icon layui-icon-app"></i> <cite>二级菜单项</cite> </a> </li></code>
Set the value of href
href
The value of the attribute can be an absolute URL or a relative URL :
or
https://).
), indicating a path relative to the current page.
Note:
attribute points to a valid URL.
is a relative URL, make sure it is the correct path relative to the current page.
function.
The above is the detailed content of How to jump to the second level of layui sidebar. For more information, please follow other related articles on the PHP Chinese website!