Commit ce0ac0c6 authored by chenqikuai's avatar chenqikuai

fix

parent 15d50d4d
......@@ -238,8 +238,12 @@ export default Vue.extend({
mounted() {
const scrollY = window.scrollY
const type = this.$route.query as any
this.iconType = type.lang || 'zh-CN'
window.sessionStorage.setItem('language', this.iconType)
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.isTop = scrollY < 70 ? true : false
window.addEventListener('scroll', () => {
......@@ -251,7 +255,7 @@ export default Vue.extend({
$route(n, o) {
const scrollY = window.scrollY
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
window.addEventListener('scroll', () => {
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