Browse Source

[优化] 全局$url增加节流防抖

master
LAPTOP-D7TKRI82\邓 4 years ago
parent
commit
841adc5f28
  1. 3
      common/mixin.js

3
common/mixin.js

@ -70,7 +70,7 @@ export default{
});
},
$url(url, options = {}){
// TODO 判断登录逻辑;防抖
this.$u.throttle(() => {
if(options.type && options.type !== ''){
if(options.type === 'redirect'){ // 关闭当前,跳转
uni.redirectTo({ url })
@ -82,6 +82,7 @@ export default{
}else{
uni.navigateTo({ url }) // 跳转
}
}, 100);
},
$toBack(){
let pages = getCurrentPages(); // 当前页

Loading…
Cancel
Save