CellSwipe

左滑唤出按钮的列表项。

引入

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

WARNING

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

例子

默认示例

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

右侧按钮内为图标

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

左侧带图标

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

点击后可跳转

<wv-group title="可跳转">
  <wv-cell-swipe title="标题文字" is-link to="/">
    <wv-cell-swipe-button type="warn" slot="right" @click.native="deleteClicked">删除</wv-cell-swipe-button>
    <wv-cell-swipe-button type="default" slot="right" @click.native="readClicked">查看</wv-cell-swipe-button>
  </wv-cell-swipe>
</wv-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描述
    -按钮内容位,可为文字或其它元素