Home >Web Front-end >Layui Tutorial >How to create tabs on layuiadmin's head

How to create tabs on layuiadmin's head

angryTom
angryTomOriginal
2019-08-01 10:15:513961browse

How to create tabs on layuiadmin's head

Today the editor will teach you how to create the tabs on layuiadmin’s head to solve the small problems you encounter in life.

If you want to know more about layui, you can click: layui tutorial

##1 , First let’s talk about the left menu bar. This is the most basic left menu bar. The implementation process is very simple. The official documentation is available, but after importing layer.js, I directly copied this official paragraph. code into my editor.

How to create tabs on layuiadmins head

2. The menu of bound attributes does not have a drop-down option. This problem was solved after I imported layer.all.js, and found that if If it is imported at the top of the page, there is no drop-down option. It can only be displayed if it is imported below the html code.

How to create tabs on layuiadmins head

3. Tab item right-click menu: The style of the right-click menu here does not have much beautification. Tab switching function, switching event monitoring, etc., need to rely on the element module.

How to create tabs on layuiadmins head

4. Add a new Tab item and pass in three parameters, corresponding to its title, the address of the tab page, and a specified id, which is the label. The attribute value of data-id.

How to create tabs on layuiadmins head

5. Pass in the specified tab item according to the incoming id. ids is an array that stores multiple ids. Call tabDelete. methods are deleted separately.

How to create tabs on layuiadmins head

6. The content in the left menu bar triggers the number of li with lay-id attribute under the click event attribute, that is The number of tab items that have been opened. Initialize a flag. If it is false, it means that the tab item has not been opened. If it is true, it means that it is already opened.

How to create tabs on layuiadmins head

The above is the detailed content of How to create tabs on layuiadmin's head. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn