Constructor
# new TriggerLock()
lock user actions until it finished
Example
//创建
import { getTriggerLock } from '@/utils/lock.js';
let locker = getTriggerLock();
export default {
onLoad(){
locker.release();
},
methods:{
onClickToProductDetail(){
locker.trigger(async () => {
let res1 = await getDataByAjax();
let res2 = await setCartItem();
let id = res2.data.data.id;
uni.navigateTo({
url: "/pages/somePage?id="+id
})
});
}
}
});