CellSwipe

左滑唤出按钮的列表项。

引入

  1. import { CellSwipe, CellSwipeButton } from 'we-vue'
  2. Vue.use(CellSwipe).use(CellSwipeButton)

WARNING

cell-swipe 只能在 group 中使用。cell-swipe-button 仅与 cell-swipe 结合使用

例子

默认示例

  1. <w-group title="默认">
  2. <w-cell-swipe title="标题文字" :value="true">
  3. <w-cell-swipe-button type="warn" slot="right" @click="deleteClicked">删除</w-cell-swipe-button>
  4. <w-cell-swipe-button type="default" slot="right" @click="readClicked">查看</w-cell-swipe-button>
  5. </w-cell-swipe>
  6. </w-group>

右侧按钮内为图标

  1. <w-group title="图标按钮">
  2. <w-cell-swipe title="标题文字" :value="true">
  3. <w-cell-swipe-button type="warn" slot="right" @click.native="deleteClicked">
  4. <i class="iconfont icon-rubish"></i>
  5. </w-cell-swipe-button>
  6. <w-cell-swipe-button type="default" slot="right" @click.native="readClicked">
  7. <i class="iconfont icon-view"></i>
  8. </w-cell-swipe-button>
  9. </w-cell-swipe>
  10. </w-group>

左侧带图标

  1. <w-group title="左侧带图标">
  2. <w-cell-swipe title="标题文字">
  3. <img :src="imgIcon" slot="icon" class="cell-icon">
  4. <w-cell-swipe-button type="warn" slot="right" @click.native="deleteClicked">删除</w-cell-swipe-button>
  5. <w-cell-swipe-button type="default" slot="right" @click.native="readClicked">查看</w-cell-swipe-button>
  6. </w-cell-swipe>
  7. </w-group>

点击后可跳转

  1. <w-group title="可跳转">
  2. <w-cell-swipe title="标题文字" is-link to="/">
  3. <w-cell-swipe-button type="warn" slot="right" @click.native="deleteClicked">删除</w-cell-swipe-button>
  4. <w-cell-swipe-button type="default" slot="right" @click.native="readClicked">查看</w-cell-swipe-button>
  5. </w-cell-swipe>
  6. </w-group>

API

  • cell-swipe
    参数类型说明可选值默认值
    titleString标题,即左侧label
    valueString内容,即左侧文字
    toString 或 Objectvue-router 跳转的目标地址,与 is-link 配合使用
    urlString跳转 url,与 is-link 配合使用
    is-linkBoolean是否为链接false

TIP

从 v1.6.0 开始,使用 to 定义 vue-router 跳转目标,使用 url 定义普通跳转。

  • cell-swipe-button
    参数类型说明可选值默认值
    typeString按钮类型'default'

Slots

  • cell-swipe

    name描述
    icon左侧图标位,参考 cell 组件
    hd中部标题位,参考 cell 组件
    ft右侧说明文字位,参考 cell 组件
    right右侧位可加入多个按钮
  • cell-swipe-button

    name描述
    -按钮内容位,可为文字或其它元素