Quantcast
Channel: CSDN博客移动开发推荐文章
Viewing all articles
Browse latest Browse all 5930

mint-ui —— cell swipe的使用

$
0
0

cell swipe

可滑动的单元格,用法同 cell

 

Import

按需引入:

import { CellSwipe } from 'mint-ui';

Vue.component(CellSwipe.name, CellSwipe);

 

全局导入:全局导入后不用再导入

import Mint from 'mint-ui'

import 'mint-ui/lib/style.css'

Vue.use(Mint);

 

 

API





示例

示例一:

xxx.vue

<template>
  <div class="page-cell">
    <div class="page-title">Cell Swipe</div>
    <mt-cell-swipe
      v-for="n in 10"
      :right="rightButtons"
      title="swipe me">
    </mt-cell-swipe>
  </div>
</template>

<script>
  export default {
    created() {
      this.rightButtons = [
        {
          content: 'Mark as Unread',
          style: { background: 'lightgray', color: '#fff' }
        },
        {
          content: 'Delete',
          style: { background: 'red', color: '#fff' },
          handler: () => this.$messagebox('delete')
        }
      ];
    },
    methods: {
      leftButtonHandler(evt) {
        console.log(123);
      }
    }
  };
</script>

 

show


向左滑动,出现了2个按钮


点击“delete”按钮,弹窗






作者:michael_ouyang 发表于2017/8/25 9:44:53 原文链接
阅读:47 评论:0 查看评论

Viewing all articles
Browse latest Browse all 5930

Trending Articles