diff --git a/package-lock.json b/package-lock.json index 77f62aa..796a2db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12538,11 +12538,6 @@ "resolved": "https://registry.npm.taobao.org/vue-infinite-loading/download/vue-infinite-loading-2.4.5.tgz", "integrity": "sha1-zCD9QK9/IBiABkQ8mbYEcM8d4bM=" }, - "vue-infinite-scroll": { - "version": "2.0.2", - "resolved": "https://registry.npm.taobao.org/vue-infinite-scroll/download/vue-infinite-scroll-2.0.2.tgz", - "integrity": "sha1-yjepH+ku4K07dKz4aCwAkXFEtxE=" - }, "vue-lazyload": { "version": "1.3.3", "resolved": "https://registry.npm.taobao.org/vue-lazyload/download/vue-lazyload-1.3.3.tgz", diff --git a/package.json b/package.json index 46286e0..ce1f94b 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "vue-codemirror": "^4.0.6", "vue-i18n": "^8.17.3", "vue-infinite-loading": "^2.4.5", - "vue-infinite-scroll": "^2.0.2", "vue-lazyload": "^1.3.3", "vue-router": "^3.1.6", "vuex": "^3.4.0" diff --git a/src/main.js b/src/main.js index 143a810..2889b62 100644 --- a/src/main.js +++ b/src/main.js @@ -11,7 +11,6 @@ import i18n from "./i18n"; // store import store from "@/store/index"; import VueClipboard from "vue-clipboard2"; -import infiniteScroll from "vue-infinite-scroll"; import VueLazyload from "vue-lazyload"; import Viewer from "v-viewer"; import cdnpath from "./libs/util.cdn"; @@ -27,7 +26,6 @@ Vue.use(ElementUI); Vue.use(VueAxios, axios); Vue.use(cdnpath); Vue.use(VueClipboard); -Vue.use(infiniteScroll); Vue.use(VueLazyload, { loading: cdnpath("/images/airplane.gif"), }); diff --git a/src/router/index.js b/src/router/index.js index cf404fb..80c9c3c 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -23,16 +23,16 @@ Vue.use(VueRouter); // 导出路由 在 main.js 里使用 const router = new VueRouter({ mode: "history", - // scrollBehavior(to, from, savePosition) { - // if (savePosition) { - // return savePosition; - // } else { - // return { - // x: 0, - // y: 0, - // }; - // } - // }, + scrollBehavior(to, from, savePosition) { + if (savePosition) { + return savePosition; + } else { + return { + x: 0, + y: 0, + }; + } + }, routes, }); diff --git a/src/store/modules/acrou/modules/cancelToken.js b/src/store/modules/acrou/modules/cancelToken.js index ab26228..691c596 100644 --- a/src/store/modules/acrou/modules/cancelToken.js +++ b/src/store/modules/acrou/modules/cancelToken.js @@ -1,36 +1,31 @@ export default { - namespaced: true, - state: { - cancelToken: [], + namespaced: true, + state: { + cancelToken: [], + }, + actions: { + push({ commit }, cancelToken) { + return new Promise((resolve) => { + commit("push", cancelToken); + resolve(); + }); }, - actions: { - push({ - commit - }, cancelToken) { - return new Promise(resolve => { - commit("push", cancelToken); - resolve() - }) - }, - cancel({ - commit - }) { - return new Promise(resolve => { - commit("clear"); - resolve() - }) - }, + cancel({ commit }) { + return new Promise((resolve) => { + commit("clear"); + resolve(); + }); }, - mutations: { - push(state, cancelToken) { - state.cancelToken.push(cancelToken) - }, - clear(state) { - console.log(state.cancelToken) - state.cancelToken.forEach(cancel => { - cancel('路由跳转取消请求'); - }); - state.cancelToken = []; - } + }, + mutations: { + push(state, cancelToken) { + state.cancelToken.push(cancelToken); }, -}; \ No newline at end of file + clear(state) { + state.cancelToken.forEach((cancel) => { + cancel(); + }); + state.cancelToken = []; + }, + }, +}; diff --git a/src/views/page/GoList.vue b/src/views/page/GoList.vue index c03fed3..43b530c 100644 --- a/src/views/page/GoList.vue +++ b/src/views/page/GoList.vue @@ -1,13 +1,7 @@