<button class="buttons" type="warn" :disabled="button" @click="preservation('ok')">关闭<span v-show="button">({{times}})</span></button>
script: data() { return { times:15, button:true, } },
methods: { getTime() { let time= window.setInterval(() => { this.times-- if(this.times===0){ this.button=false clearInterval(time) } },1000) }}