修改列表加载

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": { "webpack-bundle-analyzer": {
"version": "3.7.0", "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=", "integrity": "sha1-hNpDTolEKJm4hNmtOORm0NsCpW8=",
"dev": true, "dev": true,
"requires": { "requires": {

View File

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