HTML
CSS
JavaScript
play_arrow
HTML
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>菜单 - 通过自定义属性调用的级联菜单</title>
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mdui@1.0.1/dist/css/mdui.min.css"/>
</head>
<body class="mdui-theme-primary-indigo mdui-theme-accent-pink">

<div class="mdui-container mdui-p-t-5">
  <button class="mdui-btn mdui-color-theme-accent" mdui-menu="{target: '#demo-attr-cascade'}">cascade menu</button>

  <ul class="mdui-menu mdui-menu-cascade" id="demo-attr-cascade">
    <li class="mdui-menu-item">
      <a href="javascript:;" class="mdui-ripple">
        <i class="mdui-menu-item-icon mdui-icon material-icons">format_bold</i>
        Bold
        <span class="mdui-menu-item-helper">Ctrl+B</span>
      </a>
    </li>
    <li class="mdui-menu-item">
      <a href="javascript:;" class="mdui-ripple">
        <i class="mdui-menu-item-icon mdui-icon material-icons">format_italic</i>
        Italic
        <span class="mdui-menu-item-helper">Ctrl+I</span>
      </a>
    </li>
    <li class="mdui-menu-item">
      <a href="javascript:;" class="mdui-ripple">
        <i class="mdui-menu-item-icon"></i>
        Superscript
        <span class="mdui-menu-item-helper">Ctrl+.</span>
      </a>
    </li>
    <li class="mdui-divider"></li>
    <li class="mdui-menu-item">
      <a href="javascript:;" class="mdui-ripple">
        Paragraph style
        <span class="mdui-menu-item-more"></span>
      </a>
      <ul class="mdui-menu mdui-menu-cascade">
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">
            <i class="mdui-menu-item-icon"></i>Single
          </a>
        </li>
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">
            <i class="mdui-menu-item-icon"></i>1.15
          </a>
        </li>
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">
            <i class="mdui-menu-item-icon"></i>Double
          </a>
        </li>
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">
            <i class="mdui-menu-item-icon mdui-icon material-icons">check</i>Custom: 1.2
          </a>
        </li>
        <li class="mdui-divider"></li>
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">Add space before paragraph</a>
        </li>
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">Add space after paragraph</a>
        </li>
        <li class="mdui-divider"></li>
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">Custom spacing...</a>
        </li>
      </ul>
    </li>
    <li class="mdui-menu-item">
      <a href="javascript:;" class="mdui-ripple">
        Line spacing
        <span class="mdui-menu-item-more"></span>
      </a>
      <ul class="mdui-menu mdui-menu-cascade">
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">
            <i class="mdui-menu-item-icon"></i>
            Single
          </a>
        </li>
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">
            <i class="mdui-menu-item-icon"></i>
            1.15
          </a>
        </li>
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">
            <i class="mdui-menu-item-icon"></i>
            Double
          </a>
        </li>
        <li class="mdui-menu-item">
          <a href="javascript:;" class="mdui-ripple">
            <i class="mdui-menu-item-icon mdui-icon material-icons">check</i>
            Custom: 1.2
            <span class="mdui-menu-item-more"></span>
          </a>
          <ul class="mdui-menu mdui-menu-cascade">
            <li class="mdui-menu-item">
              <a href="javascript:;" class="mdui-ripple">
                Line spacing
                <span class="mdui-menu-item-helper">1.2</span>
              </a>
            </li>
            <li class="mdui-menu-item">
              <a href="javascript:;" class="mdui-ripple">
                Paragraph spacing before
                <span class="mdui-menu-item-helper">1.2</span>
              </a>
            </li>
            <li class="mdui-menu-item">
              <a href="javascript:;" class="mdui-ripple">
                Paragraph spacing after
                <span class="mdui-menu-item-helper">1.5</span>
              </a>
            </li>
          </ul>
        </li>
      </ul>
    </li>
  </ul>
</div>

<script src="//cdn.jsdelivr.net/npm/mdui@1.0.1/dist/js/mdui.min.js"></script>
</body>
</html>
CSS

  
JavaScript