Contacts List

优质
小牛编辑
130浏览
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>List View Contacts List</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 = "navbar">
               <div class = "navbar-inner">
                  <div class = "center sliding">List View Contacts List</div>
               </div>
            </div>
            <div class = "pages navbar-through">
               <div data-page = "index" class = "page navbar-fixed">
                  <div class = "page-content contacts-content">
                     <div class = "list-block contacts-block">
                        <div class = "list-group">
                           <ul>
                              <li class = "list-group-title">A</li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Aadi</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Aakash</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Abhay</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Abhinav</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Aditya</div>
                                    </div>
                                 </div>
                              </li>
                           </ul>
                        </div>
                        <div class = "list-group">
                           <ul>
                              <li class = "list-group-title">B</li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Bhairav</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Bhargava</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Bhooshan</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Brijesh</div>
                                    </div>
                                 </div>
                              </li>
                           </ul>
                        </div>
                        <div class = "list-group">
                           <ul>
                              <li class = "list-group-title">C</li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Chaitan</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Chandrakumar</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Chinmay</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Chirag</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Chiranjeevi</div>
                                    </div>
                                 </div>
                              </li>
                           </ul>
                        </div>
                        <div class = "list-group">
                           <ul>
                              <li class = "list-group-title">D</li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Danish</div>
                                    </div>
                                 </div>
                              </li>
                              <li>
                                 <div class = "item-content">
                                    <div class = "item-inner">
                                       <div class = "item-title">Darshan</div>
                                    </div>
                                 </div>
                              </li>
                           </ul>
                        </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>
         // here initialize the app
         var myApp = new Framework7();
         // If your using custom DOM library, then save it to $$ variable
         var $$ = Dom7;
         // Add the view
         var mainView = myApp.addView('.view-main', {
            // enable the dynamic navbar for this view
            dynamicNavbar: true
         });
      </script>
   </body>
</html>

输出 (Output)

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

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

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

  • 该示例显示了个人联系人列表。