返回介绍

Ionic4 列表项组件 ion-item-sliding

发布于 2019-11-22 18:04:17 字数 4798 浏览 1184 评论 0 收藏 0

Ionic4项目中我们可以使用Ionic4列表项组件ion-item-sliding对项目进行布局。

ion-item-sliding官方文档地址:https://ionicframework.com/docs/api/item-sliding

A sliding item contains an item that can be dragged to reveal buttons. It requires an item component as a child. All options to reveal should be placed in the item options element.

Swipe Direction

By default, the buttons are placed on the "end" side. This means that options are revealed when the sliding item is swiped from end to start, i.e. from right to left in LTR, but from left to right in RTL. To place them on the opposite side, so that they are revealed when swiping in the opposite direction, set the side attribute to "start" on the [ion-item-options]((../item-options) element. Up to two ion-item-options can be used at the same time in order to reveal two different sets of options depending on the swiping direction.

Options Layout

By default if an icon is placed with text in the item option, it will display the icon on top of the text, but the icon slot can be changed to any of the following to position it in the option.

Slotdescription
startIn LTR, start is the left side of the button, and in RTL it is the right
topThe icon is above the text
icon-onlyThe icon is the only content of the button
bottomThe icon is below the text
endIn LTR, end is the right side of the button, and in RTL it is the left

Expandable Options

Options can be expanded to take up the full width of the item if you swipe past a certain point. This can be combined with the ionSwipe event to call methods on the class.

ion-item-sliding 用法(Usage)


  
  
    
      Favorite
      Share
    

    
      Item Options
    

    
      Unread
    
  

  
  
    
      
        Delete
      
    

    
      Expandable Options
    

    
      
        Archive
      
    
  

  
  
    
      
        

HubStruck Notifications

A new message in your network

Oceanic Next has joined your network

10:45 AM Sliding Item, Icons Start More Archive Sliding Item, Icons End More Archive Sliding Item, Icons Top More Archive Sliding Item, Icons Bottom More Archive </ion-list>

  
  
    
      Favorite
      Share
    

    
      Item Options
    

    
      Unread
    
  

  
  
    
      
        Delete
      
    

    
      Expandable Options
    

    
      
        Archive
      
    
  

  
  
    
      
        

HubStruck Notifications

A new message in your network

Oceanic Next has joined your network

10:45 AM Sliding Item, Icons Start More Archive Sliding Item, Icons End More Archive Sliding Item, Icons Top More Archive Sliding Item, Icons Bottom More <span class="

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文