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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM