Skip to content

Commit 95b9550

Browse files
committed
style: format html files
1 parent eaf5455 commit 95b9550

File tree

6 files changed

+75
-30
lines changed

6 files changed

+75
-30
lines changed

packages/vue/__tests__/e2e/hydration-strat-custom.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
window.teardownCalled = true
3030
triggerEl.removeEventListener('click', hydrate)
3131
}
32-
}
32+
},
3333
})
3434

35-
const show = window.show = ref(true)
35+
const show = (window.show = ref(true))
3636
createSSRApp({
3737
setup() {
3838
onMounted(() => {
3939
window.isRootMounted = true
4040
})
41-
return () => show.value ? h(AsyncComp) : 'off'
42-
}
41+
return () => (show.value ? h(AsyncComp) : 'off')
42+
},
4343
}).mount('#app')
4444
</script>

packages/vue/__tests__/e2e/hydration-strat-idle.html

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
<script>
66
window.isHydrated = false
7-
const { createSSRApp, defineAsyncComponent, h, ref, onMounted, hydrateOnIdle } = Vue
7+
const {
8+
createSSRApp,
9+
defineAsyncComponent,
10+
h,
11+
ref,
12+
onMounted,
13+
hydrateOnIdle,
14+
} = Vue
815

916
const Comp = {
1017
setup() {
@@ -18,19 +25,20 @@
1825
}
1926

2027
const AsyncComp = defineAsyncComponent({
21-
loader: () => new Promise(resolve => {
22-
setTimeout(() => {
23-
console.log('resolve')
24-
resolve(Comp)
25-
requestIdleCallback(() => {
26-
console.log('busy')
27-
})
28-
}, 10)
29-
}),
30-
hydrate: hydrateOnIdle()
28+
loader: () =>
29+
new Promise(resolve => {
30+
setTimeout(() => {
31+
console.log('resolve')
32+
resolve(Comp)
33+
requestIdleCallback(() => {
34+
console.log('busy')
35+
})
36+
}, 10)
37+
}),
38+
hydrate: hydrateOnIdle(),
3139
})
3240

3341
createSSRApp({
34-
render: () => h(AsyncComp)
42+
render: () => h(AsyncComp),
3543
}).mount('#app')
3644
</script>

packages/vue/__tests__/e2e/hydration-strat-interaction.html

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
<div>click to hydrate</div>
44
<div id="app"><button>0</button></div>
5-
<style>body { margin: 0 }</style>
5+
<style>
6+
body {
7+
margin: 0;
8+
}
9+
</style>
610

711
<script>
812
const isFragment = location.search.includes('?fragment')
@@ -12,7 +16,14 @@
1216
}
1317

1418
window.isHydrated = false
15-
const { createSSRApp, defineAsyncComponent, h, ref, onMounted, hydrateOnInteraction } = Vue
19+
const {
20+
createSSRApp,
21+
defineAsyncComponent,
22+
h,
23+
ref,
24+
onMounted,
25+
hydrateOnInteraction,
26+
} = Vue
1627

1728
const Comp = {
1829
setup() {
@@ -22,7 +33,11 @@
2233
window.isHydrated = true
2334
})
2435
return () => {
25-
const button = h('button', { onClick: () => count.value++ }, count.value)
36+
const button = h(
37+
'button',
38+
{ onClick: () => count.value++ },
39+
count.value,
40+
)
2641
if (isFragment) {
2742
return [[h('span', 'one')], button, h('span', 'two')]
2843
} else {
@@ -34,7 +49,7 @@
3449

3550
const AsyncComp = defineAsyncComponent({
3651
loader: () => Promise.resolve(Comp),
37-
hydrate: hydrateOnInteraction(['click', 'wheel'])
52+
hydrate: hydrateOnInteraction(['click', 'wheel']),
3853
})
3954

4055
createSSRApp({
@@ -43,6 +58,6 @@
4358
window.isRootMounted = true
4459
})
4560
return () => h(AsyncComp)
46-
}
61+
},
4762
}).mount('#app')
4863
</script>

packages/vue/__tests__/e2e/hydration-strat-media.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55

66
<script>
77
window.isHydrated = false
8-
const { createSSRApp, defineAsyncComponent, h, ref, onMounted, hydrateOnMediaQuery } = Vue
8+
const {
9+
createSSRApp,
10+
defineAsyncComponent,
11+
h,
12+
ref,
13+
onMounted,
14+
hydrateOnMediaQuery,
15+
} = Vue
916

1017
const Comp = {
1118
setup() {
@@ -22,7 +29,7 @@
2229

2330
const AsyncComp = defineAsyncComponent({
2431
loader: () => Promise.resolve(Comp),
25-
hydrate: hydrateOnMediaQuery('(max-width:500px)')
32+
hydrate: hydrateOnMediaQuery('(max-width:500px)'),
2633
})
2734

2835
createSSRApp({
@@ -31,6 +38,6 @@
3138
window.isRootMounted = true
3239
})
3340
return () => h(AsyncComp)
34-
}
41+
},
3542
}).mount('#app')
3643
</script>

packages/vue/__tests__/e2e/hydration-strat-visible.html

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
<div style="height: 1000px">scroll to the bottom to hydrate</div>
44
<div id="app"><button>0</button></div>
5-
<style>body { margin: 0 }</style>
5+
<style>
6+
body {
7+
margin: 0;
8+
}
9+
</style>
610

711
<script>
812
const rootMargin = location.search.match(/rootMargin=(\d+)/)?.[1] ?? 0
@@ -13,7 +17,14 @@
1317
}
1418

1519
window.isHydrated = false
16-
const { createSSRApp, defineAsyncComponent, h, ref, onMounted, hydrateOnVisible } = Vue
20+
const {
21+
createSSRApp,
22+
defineAsyncComponent,
23+
h,
24+
ref,
25+
onMounted,
26+
hydrateOnVisible,
27+
} = Vue
1728

1829
const Comp = {
1930
setup() {
@@ -23,7 +34,11 @@
2334
window.isHydrated = true
2435
})
2536
return () => {
26-
const button = h('button', { onClick: () => count.value++ }, count.value)
37+
const button = h(
38+
'button',
39+
{ onClick: () => count.value++ },
40+
count.value,
41+
)
2742
if (isFragment) {
2843
return [[h('span', 'one')], button, h('span', 'two')]
2944
} else {
@@ -35,7 +50,7 @@
3550

3651
const AsyncComp = defineAsyncComponent({
3752
loader: () => Promise.resolve(Comp),
38-
hydrate: hydrateOnVisible({rootMargin: rootMargin + 'px'})
53+
hydrate: hydrateOnVisible({ rootMargin: rootMargin + 'px' }),
3954
})
4055

4156
createSSRApp({
@@ -44,6 +59,6 @@
4459
window.isRootMounted = true
4560
})
4661
return () => h(AsyncComp)
47-
}
62+
},
4863
}).mount('#app')
4964
</script>

packages/vue/__tests__/e2e/trusted-types.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
5+
<link rel="icon" href="data:;base64,iVBORw0KGgo=" />
66
<meta
77
http-equiv="content-security-policy"
88
content="require-trusted-types-for 'script'"

0 commit comments

Comments
 (0)