Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
xsf0105 committed Jun 9, 2023
1 parent 2dbdf9c commit b05364f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class MyComponent extends QuarkElement {
#isZhLang
#ecosystemLangs
#curHost
#isQuarkc
#isDocNotReady
#isQuarkc

// 响应式内部状态
@state() // logo
Expand All @@ -75,9 +75,6 @@ class MyComponent extends QuarkElement {
@state() // 组件 url
componentUrl = ''

@state() // 是否在quarkc
isQuarkc = false

@state() // 菜单是否激活状态
activeNav = ''

Expand All @@ -88,15 +85,16 @@ class MyComponent extends QuarkElement {
this.#isZhLang = localStorage.getItem("language") === "zh-CN"
this.#ecosystemLangs = this.#isZhLang ? langs["zh-CN"] : langs["en-US"]
this.#curHost = `https://${location.host}` // e.g. https://vue-quarkdesign.hellobike.com
this.#isQuarkc = ~location.host.indexOf('quark.hellobike.com') // 是否是 quarkc
this.#isDocNotReady = false
this.#isQuarkc = location.host.indexOf('quark.hellobike.com') > -1 ? true : false

if(~['vanilla', 'angular', 'svelte'].indexOf(location.host.split('-')[0])) {
this.#isDocNotReady = true
}
}

componentDidMount(): void {

// 默认设置语言
if(!localStorage.getItem('language')) {
localStorage.setItem('language', 'en-US')
Expand Down

0 comments on commit b05364f

Please sign in to comment.