vant SwipeCell 滑动单元格 不生效

<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组件的最新版本

猜你喜欢

转载自www.cnblogs.com/fanqiuzhuji/p/12596737.html
今日推荐