Commit ce0ac0c6 authored by chenqikuai's avatar chenqikuai

fix

parent 15d50d4d
...@@ -238,8 +238,12 @@ export default Vue.extend({ ...@@ -238,8 +238,12 @@ export default Vue.extend({
mounted() { mounted() {
const scrollY = window.scrollY const scrollY = window.scrollY
const type = this.$route.query as any const type = this.$route.query as any
this.iconType = type.lang || 'zh-CN' this.iconType =
window.sessionStorage.setItem('language', this.iconType) type.lang || window.sessionStorage.getItem('language') || 'zh-CN'
window.sessionStorage.setItem(
'language',
window.sessionStorage.getItem('language') || this.iconType,
)
this.$i18n.locale = this.iconType === 'zh-CN' ? 'zh' : 'en' this.$i18n.locale = this.iconType === 'zh-CN' ? 'zh' : 'en'
this.isTop = scrollY < 70 ? true : false this.isTop = scrollY < 70 ? true : false
window.addEventListener('scroll', () => { window.addEventListener('scroll', () => {
...@@ -251,7 +255,7 @@ export default Vue.extend({ ...@@ -251,7 +255,7 @@ export default Vue.extend({
$route(n, o) { $route(n, o) {
const scrollY = window.scrollY const scrollY = window.scrollY
this.iconType = this.iconType =
n.query.lang || window.sessionStorage.getItem('language') || 'zh-CN' window.sessionStorage.getItem('language') || n.query.lang || 'zh-CN'
this.isTop = scrollY < 70 ? true : false this.isTop = scrollY < 70 ? true : false
window.addEventListener('scroll', () => { window.addEventListener('scroll', () => {
const scrollY = window.scrollY const scrollY = window.scrollY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment