Skip to content

Commit f1a3abc

Browse files
committed
bump theme + make example output button visible on mobile
1 parent 8f8a720 commit f1a3abc

File tree

4 files changed

+38
-17
lines changed

4 files changed

+38
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@vue/repl": "^1.3.3",
13-
"@vue/theme": "^2.2.0",
13+
"@vue/theme": "^2.2.1",
1414
"dynamics.js": "^1.1.5",
1515
"gsap": "^3.9.0",
1616
"vitepress": "^1.0.0-alpha.60",

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/examples/ExampleRepl.vue

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
import { Repl, ReplStore } from '@vue/repl'
33
import '@vue/repl/style.css'
44
import { data } from './examples.data'
5-
import { inject, watchEffect, version, Ref } from 'vue'
6-
import { resolveSFCExample, resolveNoBuildExample, onHashChange } from './utils'
5+
import { inject, watchEffect, version, Ref, onMounted, ref } from 'vue'
6+
import {
7+
resolveSFCExample,
8+
resolveNoBuildExample,
9+
onHashChange
10+
} from './utils'
711
812
const store = new ReplStore({
913
defaultVueRuntimeURL: `https://unpkg.com/vue@${version}/dist/vue.esm-browser.js`
@@ -34,29 +38,46 @@ function updateExample() {
3438
preferSFC.value ? 'App.vue' : 'index.html'
3539
)
3640
}
41+
42+
const heightProvider = ref<HTMLDivElement>()
43+
onMounted(() => {
44+
const set = () => {
45+
heightProvider.value!.style.setProperty(
46+
'--vh',
47+
window.innerHeight + 'px'
48+
)
49+
}
50+
set()
51+
window.addEventListener('resize', set)
52+
})
3753
</script>
3854

3955
<template>
40-
<Repl
41-
:store="store"
42-
:showImportMap="!preferSFC"
43-
:showCompileOutput="false"
44-
:clearConsole="false"
45-
/>
56+
<div ref="heightProvider">
57+
<Repl
58+
:store="store"
59+
:showImportMap="!preferSFC"
60+
:showCompileOutput="false"
61+
:clearConsole="false"
62+
/>
63+
</div>
4664
</template>
4765

48-
<style scoped>
66+
<style>
4967
.vue-repl {
5068
max-width: 1105px;
5169
border-right: 1px solid var(--vt-c-divider-light);
52-
height: calc(100vh - var(--vt-nav-height) - var(--vt-banner-height, 0px));
70+
height: calc(
71+
var(--vh, 0px) - var(--vt-nav-height) - var(--vt-banner-height, 0px)
72+
);
5373
}
5474
5575
@media (max-width: 960px) {
5676
.vue-repl {
5777
border: none;
5878
height: calc(
59-
100vh - var(--vt-nav-height) - var(--vt-banner-height, 0px) - 48px
79+
var(--vh, 0px) - var(--vt-nav-height) - var(--vt-banner-height, 0px) -
80+
48px
6081
);
6182
}
6283
}

src/examples/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ page: true
33
title: Examples
44
aside: false
55
footer: false
6-
returnToTop: false
6+
outline: false
77
---
88

99
<script>

0 commit comments

Comments
 (0)