vuepress-theme-uniapp-official 1.4.27 → 1.4.28

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.
@@ -41,7 +41,7 @@ export default {
41
41
  onWindowResize() {
42
42
  const contentWidth = getComputedStyle(document.querySelector('.theme-default-content')).width
43
43
  if (window.matchMedia('(max-width: 410px)').matches) {
44
- this.$refs.codeIframe.style.maxWidth = contentWidth
44
+ this.$refs.codeIframe && (this.$refs.codeIframe.style.maxWidth = contentWidth)
45
45
  }
46
46
  },
47
47
  onClick(index) {
@@ -52,20 +52,8 @@ export default {
52
52
  return h(
53
53
  'a',
54
54
  {
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
- },
55
+ style: { 'margin-top': '16px', display: 'inline-block', 'text-decoration': 'none' },
56
+ attrs: { href: this.appRedirectSrc, target: '_blank' },
69
57
  },
70
58
  [
71
59
  h('Popover', {
@@ -90,27 +78,46 @@ export default {
90
78
  scopedSlots: {
91
79
  reference: props =>
92
80
  h(
93
- 'svg',
81
+ 'div',
94
82
  {
95
- class: 'app-redirect-icon',
83
+ class: 'qr-code-button',
96
84
  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',
85
+ display: 'flex',
86
+ 'justify-content': 'center',
87
+ 'align-items': 'center',
88
+ background: '#f7f8f9',
89
+ color: '#666',
90
+ padding: '0 6px',
91
+ 'border-radius': '16px',
92
+ 'font-size': '14px',
105
93
  },
106
94
  },
107
95
  [
108
- h('path', {
109
- attrs: {
110
- d: qrCodeLogoD,
111
- fill: this.src ? '#fff' : '#aaa',
96
+ h(
97
+ 'svg',
98
+ {
99
+ class: 'app-redirect-icon',
100
+ style: {
101
+ width: '26px',
102
+ height: '26px',
103
+ },
104
+ attrs: {
105
+ t: Date.now(),
106
+ viewBox: '0 0 1024 1024',
107
+ version: '1.1',
108
+ xmlns: 'http://www.w3.org/2000/svg',
109
+ },
112
110
  },
113
- }),
111
+ [
112
+ h('path', {
113
+ attrs: {
114
+ d: qrCodeLogoD,
115
+ fill: '#aaa',
116
+ },
117
+ }),
118
+ ]
119
+ ),
120
+ h('span', null, ' 扫码体验(手机浏览器跳转到App直达页)'),
114
121
  ]
115
122
  ),
116
123
  default: props =>
@@ -135,7 +142,7 @@ export default {
135
142
  'max-width': 'unset !important',
136
143
  },
137
144
  }),
138
- h('span', { style: { 'font-weight': 'bold' } }, '手机扫码体验'),
145
+ h('span', { style: { 'font-weight': 'bold' } }, '扫码体验'),
139
146
  ]
140
147
  ),
141
148
  },
@@ -184,7 +191,6 @@ export default {
184
191
  ref: 'codeIframe',
185
192
  }),
186
193
  ]),
187
- this.createQRCodeSVG(h),
188
194
  ])
189
195
  },
190
196
  },
@@ -231,17 +237,15 @@ export default {
231
237
  }
232
238
  }
233
239
  this.firstRender = false
240
+ const appRedirectQrCode = this.createQRCodeSVG(h)
234
241
  if (boxObj.length > 0) {
235
- return h('div', null, [this.wrapHeader(h, boxObj)])
242
+ return h('div', null, [appRedirectQrCode, this.wrapHeader(h, boxObj)])
236
243
  } else {
244
+ console.log('this.src :>> ', this.src)
237
245
  if (this.src) {
238
- return this.renderDom(h, this.$slots.default)
246
+ return h('div', null, [appRedirectQrCode, this.renderDom(h, this.$slots.default)])
239
247
  } 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
- ])
248
+ return h('div', null, [appRedirectQrCode, this.$slots.default])
245
249
  }
246
250
  }
247
251
  },
@@ -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.28",
4
4
  "description": "uni-app official website theme for vuepress",
5
5
  "main": "index.js",
6
6
  "repository": {