move result to separate component
This commit is contained in:
30
src/components/Result.vue
Normal file
30
src/components/Result.vue
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<script>
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'Result',
|
||||||
|
props: [
|
||||||
|
'data'
|
||||||
|
],
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.result {
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: auto;
|
||||||
|
margin: 0;
|
||||||
|
padding: 8px;
|
||||||
|
height: 100%;
|
||||||
|
display: block;
|
||||||
|
font-family: monospace;
|
||||||
|
white-space: pre;
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="result">
|
||||||
|
<pre>{{ data }}</pre>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import Result from '../components/Result.vue';
|
||||||
|
|
||||||
import Worker from '../file.worker.js?worker';
|
import Worker from '../file.worker.js?worker';
|
||||||
// const worker = new Worker();
|
// const worker = new Worker();
|
||||||
|
|
||||||
@@ -17,6 +19,7 @@ export default defineComponent({
|
|||||||
components: {
|
components: {
|
||||||
Codemirror,
|
Codemirror,
|
||||||
Splitter, SplitterPanel,
|
Splitter, SplitterPanel,
|
||||||
|
Result,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const code = `
|
const code = `
|
||||||
@@ -151,7 +154,7 @@ main {
|
|||||||
/>
|
/>
|
||||||
</SplitterPanel>
|
</SplitterPanel>
|
||||||
<SplitterPanel class="right-pane">
|
<SplitterPanel class="right-pane">
|
||||||
<pre class="result">{{ result }}</pre>
|
<Result :data="result"/>
|
||||||
</SplitterPanel>
|
</SplitterPanel>
|
||||||
</Splitter>
|
</Splitter>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
Reference in New Issue
Block a user