mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
perf: 优化消息Load效果
This commit is contained in:
parent
5f7d528d9d
commit
3631f511d4
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<ETooltip :disabled="$isEEUiApp || windowTouch || content == ''" :content="content">
|
||||
<ETooltip v-if="visible" :disabled="$isEEUiApp || windowTouch || content == ''" :content="content">
|
||||
<svg v-if="type === 'svg'" viewBox="25 25 50 50" class="common-loading">
|
||||
<circle cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10" class="common-path"></circle>
|
||||
</svg>
|
||||
@ -19,6 +19,26 @@
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
delay: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: this.delay === 0,
|
||||
timer: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.delay > 0) {
|
||||
this.timer = setTimeout(_ => {
|
||||
this.visible = true
|
||||
}, this.delay)
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.timer && clearTimeout(this.timer)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -215,7 +215,7 @@
|
||||
<div v-if="msgData.error === true" class="error" @click="onError">
|
||||
<Icon type="ios-alert" />
|
||||
</div>
|
||||
<Loading v-else-if="isLoading"/>
|
||||
<Loading v-else-if="isLoading" :delay="300"/>
|
||||
<template v-else>
|
||||
<!--时间-->
|
||||
<div v-if="timeShow" class="time" @click="timeShow=false">{{msgData.created_at}}</div>
|
||||
|
||||
2
resources/assets/js/store/getters.js
vendored
2
resources/assets/js/store/getters.js
vendored
@ -7,7 +7,7 @@ export default {
|
||||
isLoad(state) {
|
||||
return function (key) {
|
||||
const load = state.loads.find(item => item.key === key);
|
||||
return load && load.num > 0
|
||||
return !!(load && load.num > 0)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user