Skip to content

Commit 82b1cf6

Browse files
author
Barthelemy Ledoux
committed
fix(layout): remove need for nextTick
1 parent dc24992 commit 82b1cf6

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

layout.vue

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<template>
1+
<template functional>
22
<div class="preview-code">
33
<div class="preview block">
44
<slot name="preview"></slot>
@@ -10,41 +10,35 @@
1010
</template>
1111

1212
<style>
13-
.no-focus {
14-
outline: none;
15-
}
16-
1713
.preview-code {
1814
display: flex;
1915
flex-flow: row-reverse wrap;
2016
border-radius: 6px;
21-
border: 1px solid rgb(247, 247, 247);
22-
box-shadow: 0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)!important;
23-
}
24-
25-
.preview-code .editor {
26-
background-color: #2d2d2d;
17+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
18+
0 4px 6px -2px rgba(0, 0, 0, 0.05);
2719
overflow: hidden;
2820
}
2921
3022
.preview-code .block {
3123
flex-grow: 1;
32-
padding: 12px;
24+
width: 50%;
25+
}
26+
27+
.preview-code .editor .prism-editor-wrapper {
28+
height: 100%;
29+
}
30+
31+
.preview-code .editor pre {
32+
margin: 0;
33+
box-sizing: border-box;
34+
height: 100%;
35+
border-radius: 0;
3336
}
3437
3538
.preview-code .preview {
3639
background-color: rgb(249, 245, 245);
3740
text-align: center;
38-
min-width: 40%;
41+
box-sizing: border-box;
42+
padding: 12px;
3943
}
4044
</style>
41-
42-
<script>
43-
export default {
44-
mounted() {
45-
this.$nextTick(() => {
46-
document.querySelectorAll('pre').forEach(e => e.classList.add('no-focus'))
47-
}, 100)
48-
}
49-
}
50-
</script>

0 commit comments

Comments
 (0)