vuepress-theme-uniapp-official 1.6.21 → 1.6.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # vuepress-theme-uniapp-official
2
2
 
3
+ ## 1.6.23
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: 移动模式下一级菜单下拉样式异常
8
+
9
+ ## 1.6.22
10
+
11
+ ### Patch Changes
12
+
13
+ - feat: 优化 navbar 结构; 多语言配置可为空
14
+ - feat: repo config
15
+
3
16
  ## 1.6.21
4
17
 
5
18
  ### Patch Changes
@@ -18,18 +18,6 @@
18
18
  :item="item"
19
19
  />
20
20
  </div>
21
-
22
- <!-- repo link -->
23
- <!-- <a
24
- v-if="repoLink"
25
- :href="repoLink"
26
- class="repo-link"
27
- target="_blank"
28
- rel="noopener noreferrer"
29
- >
30
- {{ repoLabel }}
31
- <OutboundLink />
32
- </a> -->
33
21
  </nav>
34
22
  </template>
35
23
 
@@ -93,34 +81,6 @@ export default {
93
81
  items: (link.items || []).map(resolveNavLinkItem)
94
82
  })
95
83
  })
96
- },
97
-
98
- repoLink () {
99
- const { repo } = this.$site.themeConfig
100
- if (repo) {
101
- return /^https?:/.test(repo)
102
- ? repo
103
- : `https://github.com/${repo}`
104
- }
105
- return null
106
- },
107
-
108
- repoLabel () {
109
- if (!this.repoLink) return
110
- if (this.$site.themeConfig.repoLabel) {
111
- return this.$site.themeConfig.repoLabel
112
- }
113
-
114
- const repoHost = this.repoLink.match(/^https?:\/\/[^/]+/)[0]
115
- const platforms = ['GitHub', 'GitLab', 'Bitbucket']
116
- for (let i = 0; i < platforms.length; i++) {
117
- const platform = platforms[i]
118
- if (new RegExp(platform, 'i').test(repoHost)) {
119
- return platform
120
- }
121
- }
122
-
123
- return 'Source'
124
84
  }
125
85
  }
126
86
  }
@@ -15,9 +15,6 @@
15
15
  </div>
16
16
 
17
17
  <div class="mobile-main-navbar">
18
- <div class="mobile-links_mobile">
19
- <a href="javascript:;" class="mobile-links__btn" @click="toggleMobilePanel">{{mainNavBarText}}</a>
20
- </div>
21
18
  <div class="mobile-links__panel" :class="{open: showMobilePanel}">
22
19
  <template v-for="(item, index) in customNavBar">
23
20
  <div :class="mainNavLinkClass(index)" :key="item.text">
@@ -28,36 +25,57 @@
28
25
  </div>
29
26
  </div>
30
27
 
31
- <div class="dropdown-language" @click="switchLanguage">
32
- <div style="display: flex;align-items: center;">
33
- <span>{{navbarLanguage[navConfig.languageIndex].text}}</span>
34
- <svg t="1629441415944" viewBox="0 20 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3713"
35
- width="16" height="16" class="icon">
36
- <path
37
- d="M508.025406 655.446718c-14.45307 0-28.183486-5.781228-39.023289-15.898376l-231.249118-231.249118c-10.117149-10.117149-10.117149-26.015526 0-36.132675s26.015526-10.117149 36.132675 0l231.249118 231.249118c2.16796 2.16796 4.335921 2.16796 5.781228 0l231.971771-231.971771c10.117149-10.117149 26.015526-10.117149 35.410021 0 10.117149 10.117149 10.117149 26.015526 0 36.132674l-231.971771 231.971772c-9.394495 10.117149-23.124912 15.898377-38.300635 15.898376z"
38
- p-id="3714"></path>
39
- </svg>
28
+ <div class="main-navbar_right">
29
+ <div class="mobile-links_mobile">
30
+ <a href="javascript:;" class="mobile-links__btn" @click="toggleMobilePanel">{{mainNavBarText}}</a>
31
+ </div>
32
+
33
+ <div class="links" :style="{ top: `${this.SearchBoxTop}px` }">
34
+ <!-- <a class="switch-version" href="javascript:void(0)">回到旧版</a> -->
35
+ <DcloudSearchPage v-if="isAlgoliaSearch" ref="dcloudSearchPage" :options="algolia" />
36
+ <AlgoliaSearchBox v-if="isAlgoliaSearch" />
37
+ <SearchBox v-else-if="$site.themeConfig.search !== false && $page.frontmatter.search !== false" />
40
38
  </div>
41
- <div v-if="showLanguage" class="dropdown-content">
42
- <div
43
- v-for="(item,index) in navbarLanguage"
44
- :key="item.link"
45
- @click="() => { typeof item.click === 'function' && item.click(index === navConfig.languageIndex) }"
46
- >
47
- <a :href="index === navConfig.languageIndex ? 'javascript:;' : item.link" target="_self" :key="item.text"
48
- :class="[index === navConfig.languageIndex ? 'clickDisabled' : '']">
49
- {{item.text}}
50
- </a>
39
+
40
+ <div v-if="navbarLanguage" class="dropdown-language" @click="switchLanguage">
41
+ <div style="display: flex;align-items: center;">
42
+ <span>{{navbarLanguage[navConfig.languageIndex].text}}</span>
43
+ <svg t="1629441415944" viewBox="0 20 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3713"
44
+ width="16" height="16" class="icon">
45
+ <path
46
+ d="M508.025406 655.446718c-14.45307 0-28.183486-5.781228-39.023289-15.898376l-231.249118-231.249118c-10.117149-10.117149-10.117149-26.015526 0-36.132675s26.015526-10.117149 36.132675 0l231.249118 231.249118c2.16796 2.16796 4.335921 2.16796 5.781228 0l231.971771-231.971771c10.117149-10.117149 26.015526-10.117149 35.410021 0 10.117149 10.117149 10.117149 26.015526 0 36.132674l-231.971771 231.971772c-9.394495 10.117149-23.124912 15.898377-38.300635 15.898376z"
47
+ p-id="3714"></path>
48
+ </svg>
49
+ </div>
50
+ <div v-if="showLanguage" class="dropdown-content">
51
+ <div
52
+ v-for="(item,index) in navbarLanguage"
53
+ :key="item.link"
54
+ @click="() => { typeof item.click === 'function' && item.click(index === navConfig.languageIndex) }"
55
+ >
56
+ <a :href="index === navConfig.languageIndex ? 'javascript:;' : item.link" target="_self" :key="item.text"
57
+ :class="[index === navConfig.languageIndex ? 'clickDisabled' : '']">
58
+ {{item.text}}
59
+ </a>
60
+ </div>
51
61
  </div>
52
62
  </div>
53
- </div>
54
63
 
55
- <div class="links" :style="{ top: `${this.SearchBoxTop}px` }">
56
- <!-- <a class="switch-version" href="javascript:void(0)">回到旧版</a> -->
57
- <DcloudSearchPage v-if="isAlgoliaSearch" ref="dcloudSearchPage" :options="algolia" />
58
- <AlgoliaSearchBox v-if="isAlgoliaSearch" />
59
- <SearchBox v-else-if="$site.themeConfig.search !== false && $page.frontmatter.search !== false" />
64
+ <!-- repo link -->
65
+ <a
66
+ v-if="repoLink"
67
+ :href="repoLink"
68
+ class="repo-link"
69
+ style="color: black"
70
+ target="_blank"
71
+ rel="noopener noreferrer"
72
+ >
73
+ {{ repoLabel }}
74
+ <OutboundLink />
75
+ </a>
76
+
60
77
  </div>
78
+
61
79
  </div>
62
80
 
63
81
  <div class="sub-navbar">
@@ -119,6 +137,34 @@ export default {
119
137
 
120
138
  isAlgoliaSearch () {
121
139
  return this.algolia && this.algolia.apiKey && this.algolia.indexName
140
+ },
141
+
142
+ repoLink () {
143
+ const { repo } = this.$site.themeConfig
144
+ if (repo) {
145
+ return /^https?:/.test(repo)
146
+ ? repo
147
+ : `https://github.com/${repo}`
148
+ }
149
+ return null
150
+ },
151
+
152
+ repoLabel () {
153
+ if (!this.repoLink) return
154
+ if (this.$site.themeConfig.repoLabel) {
155
+ return this.$site.themeConfig.repoLabel
156
+ }
157
+
158
+ const repoHost = this.repoLink.match(/^https?:\/\/[^/]+/)[0]
159
+ const platforms = ['GitHub', 'GitLab', 'GitCode', 'Gitee', 'Bitbucket']
160
+ for (let i = 0; i < platforms.length; i++) {
161
+ const platform = platforms[i]
162
+ if (new RegExp(platform, 'i').test(repoHost)) {
163
+ return platform
164
+ }
165
+ }
166
+
167
+ return 'Source'
122
168
  }
123
169
  },
124
170
 
@@ -264,10 +310,6 @@ $navbar-horizontal-padding = 1.5rem
264
310
  // background-color white
265
311
  white-space nowrap
266
312
  font-size 0.9rem
267
- position absolute
268
- right $navbar-horizontal-padding
269
- top 0 //$navbar-vertical-padding
270
- transition: top 0.1s ease 0s
271
313
  display flex
272
314
  .search-box
273
315
  flex: 0 0 auto
@@ -280,7 +322,6 @@ $navbar-horizontal-padding = 1.5rem
280
322
  display none !important
281
323
  .links
282
324
  padding-left 0rem // 1.5rem
283
- top 0 !important
284
325
  .site-name
285
326
  width calc(100vw - 9.4rem)
286
327
  overflow hidden
@@ -2,7 +2,7 @@ import { navbar, navbarLanguage, userNavIndex } from '@theme-config/navbar';
2
2
 
3
3
  export default {
4
4
  data() {
5
- return { navConfig: { userNavIndex: userNavIndex || 0, languageIndex: navbarLanguage.default } }
5
+ return { navConfig: { userNavIndex: userNavIndex || 0, languageIndex: (navbarLanguage || {}).default } }
6
6
  },
7
7
 
8
8
  provide() {
@@ -12,7 +12,7 @@ export default {
12
12
  changeUserNav: this.changeUserNav,
13
13
  customNavBarKeys: this.customNavBarKeys,
14
14
  customNavBarLinks: this.customNavBarLinks,
15
- navbarLanguage: navbarLanguage.items
15
+ navbarLanguage: (navbarLanguage || {}).items
16
16
  }
17
17
  },
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuepress-theme-uniapp-official",
3
- "version": "1.6.21",
3
+ "version": "1.6.23",
4
4
  "description": "uni-app official website theme for vuepress",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -47,9 +47,9 @@
47
47
  "vuepress-plugin-mermaidjs": "1.9.1",
48
48
  "vuepress-plugin-named-chunks": "^1.1.4",
49
49
  "vuepress-plugin-zooming": "^1.1.8",
50
+ "vuepress-plugin-expandable-row": "^1.0.10",
50
51
  "vuepress-plugin-noscript-code": "^1.0.2",
51
- "vuepress-plugin-check-md2": "^1.0.5",
52
- "vuepress-plugin-expandable-row": "^1.0.10"
52
+ "vuepress-plugin-check-md2": "^1.0.5"
53
53
  },
54
54
  "resolutions": {
55
55
  "terser-webpack-plugin": "1.4.6",
@@ -28,6 +28,7 @@ $navbar-logo-height = $navbar-main-navbar-height - 2rem
28
28
  .mobile-sub-navbar
29
29
  display none
30
30
  .main-navbar
31
+ height $navbar-main-navbar-height
31
32
  color #222
32
33
  box-shadow 0 1px 0 0 rgba(0,0,0,.06)
33
34
  position relative
@@ -94,13 +95,38 @@ $navbar-logo-height = $navbar-main-navbar-height - 2rem
94
95
  span
95
96
  font-size 16px
96
97
 
98
+ .main-navbar_right
99
+ display flex
100
+ justify-content: center
101
+ align-items: center
102
+ position absolute
103
+ right $navbar-horizontal-padding
104
+ & > div:not(:last-child)
105
+ padding-right 8px
106
+ .mobile-links_mobile .mobile-links__btn
107
+ color: inherit
108
+ @media (min-width: $MQMobile)
109
+ &
110
+ display none
111
+ &:after
112
+ content ""
113
+ width 6px
114
+ height 4px
115
+ background-image url("data:image/svg+xml;charset=UTF-8,%3csvg width='6' height='4' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.23575684.6H.76852779L3.0003575 3.09954227 5.23575684.6z' fill='%23000' stroke='%23000' stroke-width='1.2' fill-rule='evenodd'/%3e%3c/svg%3e")
116
+ background-repeat no-repeat
117
+ background-size contain
118
+ display inline-block
119
+ vertical-align middle
120
+ margin-left 4px
121
+ margin-top -2px
122
+ position static
123
+ border none
124
+ transform none
125
+ background-color transparent
126
+ border-radius 0
97
127
  .dropdown-language
128
+ position relative
98
129
  user-select none
99
- position absolute
100
- right 10rem
101
- @media (max-width: $DocSearch_MQMobile)
102
- &
103
- right 4.5rem
104
130
  &>div:nth-child(1)
105
131
  cursor pointer
106
132
  svg
@@ -143,25 +169,9 @@ $navbar-logo-height = $navbar-main-navbar-height - 2rem
143
169
  justify-content flex-end
144
170
  .mobile-main-navbar
145
171
  display inline-block
146
- padding-right 170px
172
+ padding-right 230px
147
173
  a
148
174
  color $navbar-a-color
149
- .mobile-links__btn:after
150
- content ""
151
- width 6px
152
- height 4px
153
- background-image url("data:image/svg+xml;charset=UTF-8,%3csvg width='6' height='4' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.23575684.6H.76852779L3.0003575 3.09954227 5.23575684.6z' fill='%23000' stroke='%23000' stroke-width='1.2' fill-rule='evenodd'/%3e%3c/svg%3e")
154
- background-repeat no-repeat
155
- background-size contain
156
- display inline-block
157
- vertical-align middle
158
- margin-left 4px
159
- margin-top -2px
160
- position static
161
- border none
162
- transform none
163
- background-color transparent
164
- border-radius 0
165
175
  .mobile-links__panel
166
176
  text-align left
167
177
  display flex
@@ -7,5 +7,5 @@ $navbar-background-color = #f7f7f7
7
7
  $search-container-color = #f5f6f7
8
8
  $vuepress-toc-width = 14rem
9
9
  $vuepress-display-min-width = 1500px
10
- $MQMobile = 1050px
10
+ $MQMobile = 1140px
11
11
  $DocSearch_MQMobile = 1400px