List Divider

优质
小牛编辑
129浏览
2023-12-01

描述 (Description)

列表分隔符是一个带有标题的列表元素,可以在视觉上将一个列表项与另一个列表项分开。

例子 (Example)

下面的示例演示了如何使用列表分隔符,该列表分隔符将其他列表中的列表与Framework7列表视图中的不同项目分开 -

<!DOCTYPE html>
<html>
   <head>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1, 
         maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" />
      <meta name = "apple-mobile-web-app-capable" content = "yes" />
      <meta name = "apple-mobile-web-app-status-bar-style" content = "black" />
      <title>Link Elements</title>
      <link rel = "stylesheet" 
         href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" />
      <link rel = "stylesheet" 
         href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" />
   </head>
   <body>
      <div class = "views">
         <div class = "view view-main">
            <div class = "pages">
               <div data-page = "home" class = "page navbar-fixed">
                  <div class = "navbar">
                     <div class = "navbar-inner">
                        <div class = "left"> </div>
                        <div class = "center">List Divider</div>
                        <div class = "right"> </div>
                     </div>
                  </div>
                  <div class = "page-content">
                     <div class = "content-block-title">With Divider</div>
                     <div class = "list-block">
                        <ul>
                           <li class = "item-content">
                              <div class = "item-media"><i class = "icon icon-form-name"></i></div>
                              <div class = "item-inner">
                                 <div class = "item-title">Item title</div>
                                 <div class = "item-after">Label</div>
                              </div>
                           </li>
                           <li class = "item-content">
                              <div class = "item-media"><i class = "icon icon-form-name"></i></div>
                              <div class = "item-inner">
                                 <div class = "item-title">Title</div>
                              </div>
                           </li>
                           <li class = "item-divider">Title of the divider here</li>
                           <li class = "item-content">
                              <div class = "item-media"><i class = "icon icon-form-name"></i></div>
                              <div class = "item-inner">
                                 <div class = "item-title">Item with badge</div>
                                 <div class = "item-after"> <span class = "badge">78</span></div>
                              </div>
                           </li>
                           <li class = "item-content">
                              <div class = "item-media"><i class = "icon icon-form-name"></i></div>
                              <div class = "item-inner">
                                 <div class = "item-title">Another item</div>
                                 <div class = "item-after">Another label</div>
                              </div>
                           </li>
                        </ul>
                        <div class = "list-block-label">List block label text written here</div>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
      <script type = "text/javascript" 
         src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"></script>
      <script>
         var myApp = new Framework7();
      </script>
   </body>
</html>

输出 (Output)

让我们执行以下步骤,看看上面给出的代码是如何工作的 -

  • 将上面给出的HTML代码保存为服务器根文件夹中的list_views_list_divider.html文件。

  • 以http://localhost/list_views_list_divider.html打开此HTML文件,输出显示如下。

  • 此代码将一个列表项与另一个列表项分开。