返回介绍

Ionic4 排序组件 ion-reorder

发布于 2019-11-22 18:04:18 字数 2648 浏览 1055 评论 0 收藏 0

Ionic4项目中我们可以使用Ionic4排序组件ion-reorder对项目进行布局。

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

Reorder is a component that allows an item in a group of items to be dragged to change its order within that group. It must be used within an ion-reorder-group to provide a visual drag and drop interface.

ion-reorder is the anchor used to drag and drop the items inside of the ion-reorder-group. See the Reorder Group for more information on how to complete the reorder operation.

ion-reorder 用法(Usage)



  
    Item 1
  
  



  
    Item 2
  
  




  
  
    Item 3
  



  
  
    Item 4
  




  
    Item 5
  
  
    
  



  
    Item 6
  
  
    
  




  
    
      Item 7
    
  



  
    
      Item 8
    
  
</ion-reorder>


  
    Item 1
  
  



  
    Item 2
  
  




  
  
    Item 3
  



  
  
    Item 4
  




  
    Item 5
  
  
    
  



  
    Item 6
  
  
    
  




  
    
      Item 7
    
  



  
    
      Item 8
    
  
</ion-reorder>
import React from 'react';

import { IonIcon, IonItem, IonLabel, IonReorder } from '@ionic/react';

const Example: React.SFC = () => (
  
    {/*-- Default reorder icon, end aligned items --*/}
    
      
        Item 1
      
      
    

    
      
        Item 2
      
      
    

    {/*-- Default reorder icon, start aligned items --*/}
    
      
      
        Item 3
      
    

    
      
      
        Item 4
      
    

    {/*-- Custom reorder icon end items --*/}
    
      
        Item 5
      
      
        
      
    

    
      
        Item 6
      
      
        
      
    

    {/*-- Items wrapped in a reorder, entire item can be dragged --*/}
    
      
        
          Item 7
        
      
    

    
      
        
          Item 8
        
      
    
  
);

export default Example;

  
  
    
      Item 1
    
    
  

  
    
      Item 2
    
    
  

  
  
    
    
      Item 3
    
  

  
    
    
      Item 4
    
  

  
  
    
      Item 5
    
    
      
    
  

  
    
      Item 6
    
    
      
    
  

  
  
    
      
        Item 7
      
    
  

  
    
      
        Item 8
      
    
  
</template>

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

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

发布评论

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