|
|
@ -58,20 +58,21 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
changeQuery(code, url, item) { |
|
|
|
console.log('code, url, item: ', code, url, item); |
|
|
|
console.log('url: ', url); |
|
|
|
let childCode = code; |
|
|
|
if (item && item.children && item.children.length) { |
|
|
|
childCode = item.children[0].code; |
|
|
|
} |
|
|
|
if (!url) { |
|
|
|
if (this.code && code !== this.code) { |
|
|
|
// this.$router.push({ query: { code: childCode } }); |
|
|
|
const path = window.location.href.split('?') |
|
|
|
window.location.href= path[0]+`?code=${childCode}` |
|
|
|
const path = window.location.href.split('?'); |
|
|
|
window.location.href = path[0] + `?code=${childCode}`; |
|
|
|
this.$emit('changeCode', code); |
|
|
|
this.childCode = code; |
|
|
|
} else if (code === this.code) { |
|
|
|
const path = window.location.href.split('?') |
|
|
|
window.location.href= path[0]+`?code=${code}` |
|
|
|
const path = window.location.href.split('?'); |
|
|
|
window.location.href = path[0] + `?code=${code}`; |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (url === '/') { |
|
|
|