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