Skip to content

Commit

Permalink
fix(repl): source block do not render after request success
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Nov 26, 2020
1 parent b2bbbbd commit d4af36b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion repl/src/components/CodeMirror.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>

<script setup>
import { onMounted, ref, toRefs, defineEmit, defineProps } from "vue";
import { onMounted, ref, toRefs, watch, defineEmit, defineProps } from "vue";
import CodeMirror from "https://cdn.jsdelivr.net/npm/codemirror/src/codemirror.js";
const props = defineProps({
Expand All @@ -24,6 +24,10 @@ let editor;
const input = ref(null);
watch(content, (val) => {
update(val);
});
onMounted(() => {
editor = CodeMirror.fromTextArea(input.value, {
lineNumbers: true,
Expand Down

0 comments on commit d4af36b

Please sign in to comment.