<van-swipe-cell :right-width="60" :left-width="60" :on-close="onClose">
  <van-button
    square
    slot="left"
    type="danger"
    text="选择"
  />
  <van-cell
    :border="false"
    title="单元格"
    value="内容"
  />
  <van-button
    square
    slot="right"
    type="danger"
    text="删除"
  />
</van-swipe-cell>

export default {
  methods: {
    onClose(clickPosition, instance) {
      switch (clickPosition) {
        case 'left':
        case 'cell':
        case 'outside':
          instance.close();
          break;
        case 'right':
          Dialog.confirm({
            message: '确定删除吗?'
          }).then(() => {
            instance.close();
          });
          break;
      }
    }
  }
}

 

  不生效原因:1.组件是否都引入完毕

        2.是否是vant组件的最新版本

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-11-22
  • 2021-11-03
  • 2021-09-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-13
  • 2022-12-23
  • 2022-01-10
相关资源
相似解决方案