Skip to content

Commit a40a6a3

Browse files
author
Jan Bílek
committed
Remove dynamic example
1 parent d67feb5 commit a40a6a3

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

src/App.vue

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
<template>
2-
<div>
3-
<div>
4-
<h3>Dynamically update code:</h3>
5-
<textarea v-model="dynamicCode"></textarea>
6-
<code-highlight>
7-
{{dynamicCode}}
8-
</code-highlight>
9-
</div>
10-
11-
<hr />
12-
132
<code-highlight>
143
let isPalindrome = (word) => {
154
let [length, result] = [word.length, true];
@@ -22,7 +11,6 @@
2211

2312
module.exports = isPalindrome;
2413
</code-highlight>
25-
</div>
2614
</template>
2715

2816
<script>
@@ -36,7 +24,7 @@ export default {
3624
},
3725
data() {
3826
return {
39-
dynamicCode: '<div>Type here to see me change below</div>'
27+
dynamicCode: '<div>Type here to see me change below</div>',
4028
};
4129
},
4230
};
@@ -50,10 +38,6 @@ body {
5038
justify-content: center;
5139
align-items: center;
5240
}
53-
textarea {
54-
width:400px;
55-
height:200px;
56-
}
57-
@import '../themes/duotone-sea.css';
58-
@import '../themes/window.css';
41+
@import "../themes/duotone-sea.css";
42+
@import "../themes/window.css";
5943
</style>

src/CodeHighlight.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ export default {
2424
Prism.highlightAllUnder(this.$refs.codeBlock);
2525
},
2626
27-
beforeUpdate () {
28-
const newText = this.$slots.default[0].text.replace(/^[\r\n\s]*|[\r\n\s]*$/g, "");
27+
beforeUpdate() {
28+
const newText = this.$slots.default[0].text.replace(/^[\r\n\s]*|[\r\n\s]*$/g, '');
2929
this.$el.querySelector('code').textContent = newText;
3030
Prism.highlightAllUnder(this.$refs.codeBlock);
31-
}
31+
},
3232
};
3333
</script>

0 commit comments

Comments
 (0)