Git Product home page Git Product logo

ampcodehandbook's Introduction

目录配置

新增菜单项,需要在相应的配置文件里面做相应设置。

1.menu_list.js

/static/js/main/menu_list.js

var menu_list={
    amp_menu:[
        {
            name:"综合分析",
            index:"main-0",
            icon:"ys-icon-asset",
            links:"noi",
            target:"#",
            show_sub_menu:false,
            re_locate:true,//点击一级目录直接跳转
            sub_menu:[
                {
                    name:"实际",
                    index:"sub-0",
                    links:"noi",
                    target:"#",
                    re_locate:true//点击一级目录直接跳转
                }

            ]
        },

        ]//end amp_menu
     }//end menu_list

菜单配置为amp_menu对应的一个列表,

  • name:菜单名称
  • index:左侧第一级菜单ID
  • icon:左侧第一级菜单对应的图标 class
  • links,re_locate:当relocate:true时,点击第一级菜单,会根据配置的links跳转到相应页面。
  • show__sub__menu: 左侧一级菜单下是否显示2级菜单(AMP里这个配置请始终保持false)
  • target:新开页面位置(AMP由于使用angular做了单页面路由,这里target的相应功能屏蔽了,默认设置成#即可)
  • sub_menu:头部菜单,二级菜单(如果show__sub__menu:true时,同样对应左侧二级菜单)

sub_menu: 对应一个列表,里面每一项代表一个二级菜单的配置

  • name:二级菜单名称,
  • index:AMP中二级菜单id为推算绑定,这里index设置只针对show__sub__menu:true情况有效,默认对每一项写成sub-index的形式即可。
  • target:同一级菜单target;
  • links,re_locate:同一级菜单相应配置。

ampcodehandbook's People

Contributors

ghrtech avatar gitbook-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.