How to get index by mint-ui cell-swiper

< H2 > I want to get the index, as shown in the figure and delete the corresponding item according to this index < / H2 >

clipboard.png

how can it be realized?

Mar.04,2021

<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <!--  -->
  <link rel="stylesheet" href="https://unpkg.com/mint-ui/lib/style.css">
</head>

<body>
  <div id="app">
    <mt-cell-swipe v-for="item in list" :key="item" title="" :label="item" :right="GetBtn(item)">
    </mt-cell-swipe>
  </div>
</body>
<!--  Vue -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!--  -->
<script src="https://unpkg.com/mint-ui/lib/index.js"></script>
<script>
  new Vue({
    el: '-sharpapp',
    data() {
      return {
        list: '123456789'.split('')
      }
    },
    methods: {
      GetBtn(item) {
        return [{
          content: 'Delete',
          style: {
            background: 'red',
            color: '-sharpfff'
          },
          handler: () => this.handleClick(item)
        }]
      },
      handleClick: function (item) {
        this.$toast(item)
      }
    }
  })
</script>

</html>

Previous: React tsx

Next: Mysql login error

Menu