@@ -5,11 +5,13 @@ import {
5
5
useSiteLocaleData ,
6
6
} from ' @vuepress/client'
7
7
import type { DefaultThemeHomePageFrontmatter } from ' @vuepress/theme-default'
8
- import " ../home/js/micro-app-loading.js"
9
- import " ../home/js/iconfont.js"
8
+ // import MicroAppLoading from '../home/components/microapploading.vue'
10
9
11
10
const frontmatter = usePageFrontmatter <DefaultThemeHomePageFrontmatter >()
12
11
const siteLocale = useSiteLocaleData ()
12
+ const base = siteLocale .value .base
13
+
14
+ console .log (' base' , base )
13
15
14
16
const heroText = computed (() => {
15
17
if (frontmatter .value .heroText === null ) {
@@ -42,61 +44,61 @@ const loadingConTwo = ref(true)
42
44
43
45
44
46
onMounted (() => {
45
- const observer1 = new IntersectionObserver (([{ intersectionRatio }]) => {
46
- if (intersectionRatio <= 0 ) return
47
- observer1 .disconnect ()
48
- showContentOneImg .value = true
47
+ // const observer1 = new IntersectionObserver(([{ intersectionRatio }]) => {
48
+ // if (intersectionRatio <= 0) return
49
+ // observer1.disconnect()
50
+ // showContentOneImg.value = true
49
51
50
- setTimeout (() => { loadingConOne .value = false }, 1100 )
52
+ // setTimeout(() => { loadingConOne.value = false}, 1100)
51
53
52
- // <micro-app-loading size='0.3' class="loading-logo"></micro-app-loading>
53
- setTimeout (() => {
54
- const myApp = document .createElement (' micro-app' ) as HTMLElement
55
- myApp .setAttribute (' name' , ' my-app1' )
56
- myApp .setAttribute (' disable-memory-router' , ' true' )
57
- myApp .setAttribute (' url' , ` https://zeroing.jd.com/micro-app/react17/ ` )
58
- myApp .addEventListener (' mounted' , () => {
59
- microAppConOne .value ?.removeChild (microAppConOne .value .children [0 ])
60
- })
61
- microAppConOne .value ?.appendChild (myApp )
62
- }, 3000 )
63
- })
54
+ // // <micro-app-loading size='0.3' class="loading-logo"></micro-app-loading>
55
+ // setTimeout(() => {
56
+ // const myApp = document.createElement('micro-app') as HTMLElement
57
+ // myApp.setAttribute('name', 'my-app1')
58
+ // myApp.setAttribute('disable-memory-router', 'true')
59
+ // myApp.setAttribute('url', `https://zeroing.jd.com/micro-app/react17/`)
60
+ // myApp.addEventListener('mounted', () => {
61
+ // microAppConOne.value?.removeChild(microAppConOne.value.children[0])
62
+ // })
63
+ // microAppConOne.value?.appendChild(myApp)
64
+ // }, 3000)
65
+ // })
64
66
65
- observer1 .observe (contentOneImg .value as Element )
67
+ // observer1.observe(contentOneImg.value as Element)
66
68
67
- const observer2 = new IntersectionObserver (([{ intersectionRatio }]) => {
68
- if (intersectionRatio <= 0 ) return
69
- observer2 .disconnect ()
70
- showContentTwoImg .value = true
71
- })
69
+ // const observer2 = new IntersectionObserver(([{ intersectionRatio }]) => {
70
+ // if (intersectionRatio <= 0) return
71
+ // observer2.disconnect()
72
+ // showContentTwoImg.value = true
73
+ // })
72
74
73
- observer2 .observe (contentTwoImg1 .value as Element )
75
+ // observer2.observe(contentTwoImg1.value as Element)
74
76
75
- const observer3 = new IntersectionObserver (([{ intersectionRatio }]) => {
76
- if (intersectionRatio <= 0 ) return
77
- observer3 .disconnect ()
78
- showContentTwoImg2 .value = true
77
+ // const observer3 = new IntersectionObserver(([{ intersectionRatio }]) => {
78
+ // if (intersectionRatio <= 0) return
79
+ // observer3.disconnect()
80
+ // showContentTwoImg2.value = true
79
81
80
- setTimeout (() => { loadingConTwo .value = false }, 1100 )
82
+ // setTimeout(() => { loadingConTwo.value = false }, 1100)
81
83
82
- setTimeout (() => {
83
- const myApp = document .createElement (' micro-app' )
84
- myApp .setAttribute (' name' , ' my-app2' )
85
- myApp .setAttribute (' url' , ` https://zeroing.jd.com/micro-app/react17/ ` )
86
- myApp .setAttribute (' disable-memory-router' , ' true' )
87
- myApp .addEventListener (' mounted' , () => {
88
- microAppConTwo .value ?.removeChild (microAppConTwo .value ?.children [0 ])
89
- })
90
- microAppConTwo .value ?.appendChild (myApp )
91
- }, 3000 );
92
- })
93
- observer3 .observe (contentTwoImg2 .value as Element )
84
+ // setTimeout(() => {
85
+ // const myApp = document.createElement('micro-app')
86
+ // myApp.setAttribute('name', 'my-app2')
87
+ // myApp.setAttribute('url', `https://zeroing.jd.com/micro-app/react17/`)
88
+ // myApp.setAttribute('disable-memory-router', 'true')
89
+ // myApp.addEventListener('mounted', () => {
90
+ // microAppConTwo.value?.removeChild(microAppConTwo.value?.children[0])
91
+ // })
92
+ // microAppConTwo.value?.appendChild(myApp)
93
+ // }, 3000);
94
+ // })
95
+ // observer3.observe(contentTwoImg2.value as Element)
94
96
95
- onBeforeUnmount (() => {
96
- observer1 .disconnect ()
97
- observer2 .disconnect ()
98
- observer3 .disconnect ()
99
- })
97
+ // onBeforeUnmount(() => {
98
+ // observer1.disconnect()
99
+ // observer2.disconnect()
100
+ // observer3.disconnect()
101
+ // })
100
102
})
101
103
</script >
102
104
@@ -111,10 +113,10 @@ onMounted(() => {
111
113
</a >
112
114
</div >
113
115
<nav class =' header-nav' >
114
- <a class =' header-nav-title' href =" / zh/" >文档</a >
115
- <a class =' header-nav-title' href =" / v0/zh/" >0.x文档</a >
116
+ <a class =' header-nav-title' : href =" base + ' zh/' " >文档</a >
117
+ <a class =' header-nav-title' : href =" base + ' v0/zh/' " >0.x文档</a >
116
118
<a class =' header-nav-title' href =" https://zeroing.jd.com/micro-app/demo/" target =" blank" >示例</a >
117
- <a class =' header-nav-title' href =" / zh/micro-app-devtools" >Micro-App-DevTools</a >
119
+ <a class =' header-nav-title' : href =" base + ' zh/micro-app-devtools' " >Micro-App-DevTools</a >
118
120
<a class =' header-nav-title' href =" https://github.com/micro-zoe/micro-app" target =" blank" ><img
119
121
class =' github-icon' src =" ../home/assets/github-logo.png" alt =" github" ></a >
120
122
</nav >
@@ -123,7 +125,7 @@ onMounted(() => {
123
125
<div v-if =" heroText" class =' introduce-title' >{{ heroText }}</div >
124
126
<p v-if =" tagline" class =' introduce-desc' >{{ tagline }}</p >
125
127
<div class =" introduce-btn-list" >
126
- <a href =" / zh/" class =' btn-start' >开始使用</a >
128
+ <a : href =" base + ' zh/' " class =' btn-start' >开始使用</a >
127
129
<a href =" https://zeroing.jd.com/micro-app/demo/" class =' btn-coding' target =" blank" >在线案例</a >
128
130
</div >
129
131
</section >
@@ -158,7 +160,7 @@ onMounted(() => {
158
160
src =" ../home/assets/arrow-right.png" alt =" " >
159
161
<div class =' micro-app-con micro-app-con-one' :class =" { 'micro-app-con-show': showContentOneImg }"
160
162
ref =" microAppConOne" >
161
- <micro-app-loading size =' 0.3' class =" loading-logo" :class =" { hidden: loadingConOne }" ></micro-app-loading >
163
+ <!-- < micro-app-loading size='0.3' class="loading-logo" :class="{ hidden: loadingConOne }"></micro-app-loading> -- >
162
164
</div >
163
165
</div >
164
166
</section >
@@ -192,59 +194,45 @@ onMounted(() => {
192
194
<div class =" ability-list-cont" >
193
195
<div class =" ability-item" >
194
196
<div class =" ability-item-icon-con" >
195
- <svg class =" icon ability-icon-sandbox" aria-hidden =" true" >
196
- <use xlink:href =" #icon-sandbox" ></use >
197
- </svg >
197
+ <span class =" microdocs icon-codesandbox" />
198
198
</div >
199
199
<h4 >JS沙箱</h4 >
200
200
</div >
201
201
<div class =" ability-item" >
202
202
<div class =" ability-item-icon-con ability-item-icon-css" >
203
- <svg class =" icon ability-icon-css" aria-hidden =" true" >
204
- <use xlink:href =" #icon-css" ></use >
205
- </svg >
206
- <svg class =" icon ability-icon-css" aria-hidden =" true" >
207
- <use xlink:href =" #icon-css" ></use >
208
- </svg >
203
+ <span class =" microdocs icon-css ability-icon-css" />
204
+ <span class =" microdocs icon-css ability-icon-css" />
209
205
</div >
210
206
<h4 >样式隔离</h4 >
211
207
</div >
212
208
<div class =" ability-item" >
213
209
<div class =" ability-item-icon-con ability-item-icon-element" >
214
- <svg class =" icon ability-icon-element" aria-hidden =" true" >
215
- <use xlink:href =" #icon-element" ></use >
216
- </svg >
210
+ <span class =" microdocs icon-element" />
217
211
</div >
218
212
<h4 >元素隔离</h4 >
219
213
</div >
220
214
<div class =" ability-item" >
221
215
<div class =" ability-item-icon-con ability-item-icon-tongxun" >
222
- <svg class =" icon ability-icon-tongxun" aria-hidden =" true" >
223
- <use xlink:href =" #icon-tongxun" ></use >
224
- </svg >
216
+ <span class =" microdocs icon-tongxun" />
225
217
</div >
226
218
<h4 >数据通信</h4 >
227
219
</div >
228
220
<div class =" ability-item" >
229
221
<div class =" ability-item-icon-con ability-item-icon-plugin" >
230
- <svg class =" icon ability-icon-plugin" aria-hidden =" true" >
231
- <use xlink:href =" #icon-plugin" ></use >
232
- </svg >
222
+ <span class =" microdocs icon-plugin" />
233
223
</div >
234
224
<h4 >插件系统</h4 >
235
225
</div >
236
226
<div class =" ability-item" >
237
227
<div class =" ability-item-icon-con ability-item-icon-prefetch" >
238
- <svg class =" icon ability-icon-prefetch" aria-hidden =" true" >
239
- <use xlink:href =" #icon-prefetch" ></use >
240
- </svg >
228
+ <span class =" microdocs icon-prefetch" />
241
229
</div >
242
230
<h4 >预加载</h4 >
243
231
</div >
244
232
</div >
245
233
</section >
246
234
<div class =" content-thrid-btn" >
247
- <a href =" / zh/" class =' btn-start' >快速开始</a >
235
+ <a : href =" base + ' zh/' " class =' btn-start' >快速开始</a >
248
236
</div >
249
237
</section >
250
238
<footer class =" footer" >
@@ -265,8 +253,10 @@ onMounted(() => {
265
253
</dd >
266
254
</dl >
267
255
</div >
268
- </footer >
269
- </main ></template >
256
+ </footer >
257
+ </main >
258
+ </template >
270
259
271
260
<style src="../home/css/index.css " scoped></style >
272
261
<style src="../home/css/animation.css " scoped></style >
262
+ <style src="../home/fonts/iconfont.css " scoped></style >
0 commit comments