Skip to content

Commit

Permalink
feat: home link update
Browse files Browse the repository at this point in the history
  • Loading branch information
xsf0105 committed Jun 8, 2023
1 parent 6c2d796 commit 42a9894
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ const langs = {

@customElement({ tag: "quark-doc-header", style })
class MyComponent extends QuarkElement {
// 非响应式变量
#isZhLang
#ecosystemLangs
#curHost
#isQuarkc

// 响应式内部状态
@state() // logo
Expand Down Expand Up @@ -85,6 +87,7 @@ 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
}


Expand Down Expand Up @@ -129,7 +132,6 @@ class MyComponent extends QuarkElement {
} else {
this._quarkcLogoSwitch()
this.githubUrl = 'https://github.com/hellof2e/quark'
this.isQuarkc = true
}
}

Expand Down Expand Up @@ -187,7 +189,7 @@ class MyComponent extends QuarkElement {
<div class="toper-bar">
<div class="menu-group">
{
this.isQuarkc ? null :
this.#isQuarkc ? null :
<Fragment>
<div class={this.activeNav === 'guide'? 'nav-item menu active-nav' : 'nav-item menu'}>
<a
Expand Down

0 comments on commit 42a9894

Please sign in to comment.