vuepress-theme-uniapp-official 1.4.27 → 1.4.29

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.
@@ -355,7 +355,12 @@
355
355
  let categoryArr = [`category:${this.currentCategory.text}`];
356
356
  if (this.currentCategory.text === 'uni-app') {
357
357
  // category:uni-app OR tag:UTS OR tag:插件
358
- categoryArr.push('tag:UTS', 'tag:插件')
358
+ categoryArr.push('tag:UTS', 'tag:插件', 'tag:全局文件')
359
+ categoryArr = [categoryArr];
360
+ }
361
+ if (this.currentCategory.text === 'uni-app x') {
362
+ // category:uni-app OR tag:UTS OR tag:插件
363
+ categoryArr.push('tag:插件', 'tag:教程', 'tag:工程化', 'tag:全局文件')
359
364
  categoryArr = [categoryArr];
360
365
  }
361
366
  return searchClient(
@@ -2,11 +2,36 @@
2
2
  import clientRootMixin from 'vuepress-plugin-juejin-style-copy/clientRootMixin'
3
3
  import Popover from './Popover.vue'
4
4
 
5
- const qrCodeLogoD =
6
- 'M597.333333 597.333333h85.333334v-85.333333h85.333333v128h-85.333333v42.666667h-85.333334v-42.666667h-85.333333v-128h85.333333v85.333333z m-384-85.333333h256v256H213.333333v-256z m85.333334 85.333333v85.333334h85.333333v-85.333334H298.666667zM213.333333 213.333333h256v256H213.333333V213.333333z m85.333334 85.333334v85.333333h85.333333V298.666667H298.666667z m213.333333-85.333334h256v256h-256V213.333333z m85.333333 85.333334v85.333333h85.333334V298.666667h-85.333334z m85.333334 384h85.333333v85.333333h-85.333333v-85.333333z m-170.666667 0h85.333333v85.333333h-85.333333v-85.333333z'
7
5
  const appRedirectKeyword = 'appRedirect'
8
6
  let imageIndex = 0
9
7
 
8
+ function createSVG(h) {
9
+ return h(
10
+ 'svg',
11
+ {
12
+ class: 'app-redirect-icon',
13
+ style: {
14
+ width: '26px',
15
+ height: '26px',
16
+ },
17
+ attrs: {
18
+ t: Date.now(),
19
+ viewBox: '0 0 1024 1024',
20
+ version: '1.1',
21
+ xmlns: 'http://www.w3.org/2000/svg',
22
+ },
23
+ },
24
+ [
25
+ h('path', {
26
+ attrs: {
27
+ d: 'M597.333333 597.333333h85.333334v-85.333333h85.333333v128h-85.333333v42.666667h-85.333334v-42.666667h-85.333333v-128h85.333333v85.333333z m-384-85.333333h256v256H213.333333v-256z m85.333334 85.333333v85.333334h85.333333v-85.333334H298.666667zM213.333333 213.333333h256v256H213.333333V213.333333z m85.333334 85.333334v85.333333h85.333333V298.666667H298.666667z m213.333333-85.333334h256v256h-256V213.333333z m85.333333 85.333334v85.333333h85.333334V298.666667h-85.333334z m85.333334 384h85.333333v85.333333h-85.333333v-85.333333z m-170.666667 0h85.333333v85.333333h-85.333333v-85.333333z',
28
+ fill: '#aaa',
29
+ },
30
+ }),
31
+ ]
32
+ )
33
+ }
34
+
10
35
  export default {
11
36
  mixins: [clientRootMixin],
12
37
  components: { Popover },
@@ -41,31 +66,19 @@ export default {
41
66
  onWindowResize() {
42
67
  const contentWidth = getComputedStyle(document.querySelector('.theme-default-content')).width
43
68
  if (window.matchMedia('(max-width: 410px)').matches) {
44
- this.$refs.codeIframe.style.maxWidth = contentWidth
69
+ this.$refs.codeIframe && (this.$refs.codeIframe.style.maxWidth = contentWidth)
45
70
  }
46
71
  },
47
72
  onClick(index) {
48
73
  this.activeIndex = index
49
74
  },
50
- createQRCodeSVG(h, style) {
75
+ createQRCodeSVG(h) {
51
76
  if (this.appRedirectSrc) {
52
77
  return h(
53
78
  'a',
54
79
  {
55
- style: Object.assign(
56
- {
57
- position: 'absolute',
58
- top: '5px',
59
- right: '12px',
60
- cursor: 'pointer',
61
- 'z-index': 5,
62
- },
63
- style
64
- ),
65
- attrs: {
66
- href: this.appRedirectSrc,
67
- target: '_blank',
68
- },
80
+ style: { 'margin-top': '16px', display: 'inline-block', 'text-decoration': 'none' },
81
+ attrs: { href: this.appRedirectSrc, target: '_blank' },
69
82
  },
70
83
  [
71
84
  h('Popover', {
@@ -90,28 +103,21 @@ export default {
90
103
  scopedSlots: {
91
104
  reference: props =>
92
105
  h(
93
- 'svg',
106
+ 'div',
94
107
  {
95
- class: 'app-redirect-icon',
108
+ class: 'qr-code-button',
96
109
  style: {
97
- width: '32px',
98
- height: '32px',
99
- },
100
- attrs: {
101
- t: Date.now(),
102
- viewBox: '0 0 1024 1024',
103
- version: '1.1',
104
- xmlns: 'http://www.w3.org/2000/svg',
110
+ display: 'flex',
111
+ 'justify-content': 'center',
112
+ 'align-items': 'center',
113
+ background: '#f7f8f9',
114
+ color: '#666',
115
+ padding: '0 6px',
116
+ 'border-radius': '16px',
117
+ 'font-size': '14px',
105
118
  },
106
119
  },
107
- [
108
- h('path', {
109
- attrs: {
110
- d: qrCodeLogoD,
111
- fill: this.src ? '#fff' : '#aaa',
112
- },
113
- }),
114
- ]
120
+ [createSVG(h), h('span', null, ' 扫码体验(手机浏览器跳转到App直达页)')]
115
121
  ),
116
122
  default: props =>
117
123
  h(
@@ -135,7 +141,7 @@ export default {
135
141
  'max-width': 'unset !important',
136
142
  },
137
143
  }),
138
- h('span', { style: { 'font-weight': 'bold' } }, '手机扫码体验'),
144
+ h('span', { style: { 'font-weight': 'bold' } }, '扫码体验'),
139
145
  ]
140
146
  ),
141
147
  },
@@ -184,7 +190,6 @@ export default {
184
190
  ref: 'codeIframe',
185
191
  }),
186
192
  ]),
187
- this.createQRCodeSVG(h),
188
193
  ])
189
194
  },
190
195
  },
@@ -231,17 +236,14 @@ export default {
231
236
  }
232
237
  }
233
238
  this.firstRender = false
239
+ const appRedirectQrCode = this.createQRCodeSVG(h)
234
240
  if (boxObj.length > 0) {
235
- return h('div', null, [this.wrapHeader(h, boxObj)])
241
+ return h('div', null, [appRedirectQrCode, this.wrapHeader(h, boxObj)])
236
242
  } else {
237
243
  if (this.src) {
238
- return this.renderDom(h, this.$slots.default)
244
+ return h('div', null, [appRedirectQrCode, this.renderDom(h, this.$slots.default)])
239
245
  } else {
240
- const appRedirectQrCode = this.createQRCodeSVG(h, { right: '100px', top: '0' })
241
- return h('div', appRedirectQrCode ? { style: { position: 'relative' } } : null, [
242
- appRedirectQrCode,
243
- this.$slots.default,
244
- ])
246
+ return h('div', null, [appRedirectQrCode, this.$slots.default])
245
247
  }
246
248
  }
247
249
  },
@@ -323,9 +325,7 @@ export default {
323
325
  div[class*="language-"]
324
326
  margin 0 !important
325
327
 
326
- /* .page-runtime pre::-webkit-scrollbar {
327
- display: none
328
- } */
328
+
329
329
  ::-webkit-scrollbar {
330
330
  width: 8px !important;
331
331
  height: 8px !important;
@@ -113,7 +113,7 @@ const vPopover = {
113
113
  .popover-content-wrapper {
114
114
  position: absolute;
115
115
  background-color: #fff;
116
- z-index: 5;
116
+ z-index: 11;
117
117
  border-radius: 5px;
118
118
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
119
119
  transition: opacity .1s cubic-bezier(0.57, 0.85, 0.85, 0.57);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuepress-theme-uniapp-official",
3
- "version": "1.4.27",
3
+ "version": "1.4.29",
4
4
  "description": "uni-app official website theme for vuepress",
5
5
  "main": "index.js",
6
6
  "repository": {