1.思路:
单个按钮的话=>将disabled=true并改变背景色
2.案例:
<template>
<button class="btn" :class='{active:isAddShow==true}'
@click="saveData()" :disabled="isAddShow">确定</button>
</template>
<script>
export default {
data() {
return {
isAddShow:false,
}
},
methods:{
saveData(){
const that=this
......
uni.showModal({
title: '提示',
content: '派车成功',
showCancel: false,
success: (res) => {
if (res.confirm) {
that.isAddShow = true
}
}
});
/*
提交成功后 提交按钮一分钟内灰色,不能点击,一分钟后恢复
*/
setTimeout(function() {
that.isAddShow = false
}, 1000 * 60);
},
},