This commit is contained in:
outception 2019-07-18 05:34:50 +00:00 committed by GitHub
commit 7274d99553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 12 deletions

View File

@ -91,7 +91,7 @@
"husky": "1.3.1",
"lint-staged": "8.1.5",
"mockjs": "1.0.1-beta3",
"node-sass": "^4.9.0",
"node-sass": "^4.12.0",
"plop": "2.3.0",
"runjs": "^4.3.2",
"sass-loader": "^7.1.0",

View File

@ -11,6 +11,12 @@ NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/login', '/auth-redirect'] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
// skip some code, make tab work with router smoother
if (to.path === from.path) {
next()
return
}
// start progress bar
NProgress.start()

View File

@ -26,20 +26,18 @@ export default {
{ label: 'Japan', key: 'JP' },
{ label: 'Eurozone', key: 'EU' }
],
activeName: 'CN',
createdTimes: 0
}
},
watch: {
activeName(val) {
this.$router.push(`${this.$route.path}?tab=${val}`)
}
},
created() {
// init the default selected tab
const tab = this.$route.query.tab
if (tab) {
this.activeName = tab
computed: {
activeName: {
get() {
return this.$route.query.tab || 'CN'
},
set(tab) {
// this.$router.push({ query: { tab }})
this.$router.replace({ query: { tab }})
}
}
},
methods: {