mirror of
https://github.com/viarotel-org/escrcpy.git
synced 2024-11-30 18:24:27 +01:00
perf: 💄 Optimize device refresh mode
This commit is contained in:
parent
4508758fb3
commit
ea75615a46
@ -29,7 +29,7 @@
|
|||||||
<div class="pt-4 flex-1 h-0 overflow-hidden">
|
<div class="pt-4 flex-1 h-0 overflow-hidden">
|
||||||
<el-table
|
<el-table
|
||||||
ref="elTable"
|
ref="elTable"
|
||||||
v-loading="loading"
|
v-loading="loading && !deviceList.length"
|
||||||
:element-loading-text="$t('common.loading')"
|
:element-loading-text="$t('common.loading')"
|
||||||
:data="deviceList"
|
:data="deviceList"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@ -213,8 +213,10 @@ export default {
|
|||||||
this.$refs.wirelessGroupRef.connect(...args)
|
this.$refs.wirelessGroupRef.connect(...args)
|
||||||
},
|
},
|
||||||
|
|
||||||
handleRefresh() {
|
async handleRefresh() {
|
||||||
this.getDeviceData({ resetResolve: true })
|
this.loading = true
|
||||||
|
await sleep(500)
|
||||||
|
this.getDeviceData({ resetResolve: true, unloading: true })
|
||||||
},
|
},
|
||||||
|
|
||||||
async handleReset() {
|
async handleReset() {
|
||||||
@ -247,10 +249,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async getDeviceData({ resetResolve = false } = {}) {
|
async getDeviceData(options = {}) {
|
||||||
this.loading = true
|
const { resetResolve = false, unloading = false } = options
|
||||||
|
|
||||||
await sleep(500)
|
if (!unloading) {
|
||||||
|
this.loading = true
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await this.$store.device.getList()
|
const data = await this.$store.device.getList()
|
||||||
|
Loading…
Reference in New Issue
Block a user