修改列表加载

This commit is contained in:
qxz 2020-05-08 14:08:39 +08:00
parent f83cfaba0d
commit 293f05bb72
2 changed files with 16 additions and 17 deletions

2
package-lock.json generated
View File

@ -12327,7 +12327,7 @@
},
"webpack-bundle-analyzer": {
"version": "3.7.0",
"resolved": "https://registry.npm.taobao.org/webpack-bundle-analyzer/download/webpack-bundle-analyzer-3.7.0.tgz?cache=0&sync_timestamp=1586846510646&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwebpack-bundle-analyzer%2Fdownload%2Fwebpack-bundle-analyzer-3.7.0.tgz",
"resolved": "https://registry.npm.taobao.org/webpack-bundle-analyzer/download/webpack-bundle-analyzer-3.7.0.tgz?cache=0&sync_timestamp=1586846559504&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwebpack-bundle-analyzer%2Fdownload%2Fwebpack-bundle-analyzer-3.7.0.tgz",
"integrity": "sha1-hNpDTolEKJm4hNmtOORm0NsCpW8=",
"dev": true,
"requires": {

View File

@ -1,6 +1,6 @@
<template>
<div>
<headmd :option="headmd" v-show="headmd.display"></headmd>
<headmd :option="headmd" v-if="headmd.display"></headmd>
<div class="golist">
<table class="table is-hoverable">
<thead>
@ -21,7 +21,7 @@
</thead>
<tbody>
<tr v-for="(file,index) in files" v-bind:key="index">
<td @click="go(file, 'view')">
<td @click="go(file, file.mimeType!=='application/vnd.google-apps.folder'?'view':'')">
<svg class="iconfont" aria-hidden="true">
<use :xlink:href="getIcon(file.mimeType)" />
</svg>
@ -69,7 +69,7 @@
</div>
</div>
<hr />
<readmemd :option="readmemd" v-show="readmemd.display"></readmemd>
<readmemd :option="readmemd" v-if="readmemd.display"></readmemd>
</div>
</template>
@ -297,20 +297,19 @@ export default {
},
watch: {
$route (to, from) {
if (!to.path.indexOf(':search')) {
// 退page_token
if (to.path.length < from.path.length) {
this.page.page_token = null;
}
if (to.path.substr(-1) !== '/' && from.meta.view !== "list") {
return
}
// 退page_token
if (to.path.length < from.path.length) {
this.page.page_token = null;
}
if ((to.path.indexOf(':search') > 0) || (to.path.substr(-1) === '/' && from.meta.view === "list")) {
this.render();
}
this.headmd = { display: false, file: {}, path: "" },
this.readmemd = { display: false, file: {}, path: "" }
this.render();
}
}
},
// beforeRouteUpdate (to, from, next) {
// this.headmd = { display: false, file: {}, path: "" },
// this.readmemd = { display: false, file: {}, path: "" }
// next()
// },
};
</script>