New operation quickly click to insert multiple pieces of the same data how to deal with?

problem description

.stop

related codes

/ / Please paste the code text below (do not replace the code with pictures)

        <div slot="footer">
            <i-button type="primary" size="large" @click="connect("modifyForm")"></i-button>
            <i-button type="primary" size="large" @click="cancel("modifyForm")"></i-button>
            <i-button type="primary" size="large" @click="ok("modifyForm")"></i-button>
        </div>

what result do you expect? What is the error message actually seen?

multiple clicks in a row can only pass data to the background once

Oct.03,2021

doesn't the button of iview have a loading status? bind the loading status, judge the loading status when you click, and set the loading to false after adding it

.
<template>
    <button loading={this.loading} @click={handleClick}></button>
</template>

<script>
    data() {
        return {
            loading: false
        }
    }
    
    methods: {
       handleClick() {
           if (this.loading) {
               return
           }
           this.loading = true
           axios.get('').then(res => {
               this.loading = false
           })
       } 
    }
</script>

that's probably the logic


use the tag before calling the API. When lock=true, receives a response (normal return or error), set it to false, multiple clicks according to lock to block the following clicks.

Menu