move initial code to config
This commit is contained in:
@@ -1,3 +1,15 @@
|
|||||||
|
|
||||||
export const MAX_DATA_SIZE = 1e5;
|
export const MAX_DATA_SIZE = 1e5;
|
||||||
export const ERROR_MAX_DATA_SIZE = 'Error: Output exceeded maximum size allowed';
|
export const ERROR_MAX_DATA_SIZE = 'Error: Output exceeded maximum size allowed';
|
||||||
|
export const WELCOME_CODE = `
|
||||||
|
'Hello World!';
|
||||||
|
|
||||||
|
new Array(10).fill(0).map((_, i) => '#'.repeat(i+1));
|
||||||
|
|
||||||
|
2n ** 42n;
|
||||||
|
|
||||||
|
for (let i = 0; i < 42; ++i) {
|
||||||
|
console.log(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
`;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import Result from '../components/Result.vue';
|
import Result from '../components/Result.vue';
|
||||||
import Code from '../components/Code.vue';
|
import Code from '../components/Code.vue';
|
||||||
|
import { WELCOME_CODE } from '../app.config';
|
||||||
|
|
||||||
import Worker from '../file.worker.js?worker';
|
import Worker from '../file.worker.js?worker';
|
||||||
|
|
||||||
@@ -18,20 +19,8 @@ export default defineComponent({
|
|||||||
Result, Code,
|
Result, Code,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const code = `
|
|
||||||
'Hello World!';
|
|
||||||
|
|
||||||
new Array(10).fill(0).map((_, i) => '#'.repeat(i+1));
|
|
||||||
|
|
||||||
2n ** 42n;
|
|
||||||
|
|
||||||
for (let i = 0; i < 42; ++i) {
|
|
||||||
console.log(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
`;
|
|
||||||
return {
|
return {
|
||||||
code: { value: code },
|
code: { value: WELCOME_CODE },
|
||||||
worker: null,
|
worker: null,
|
||||||
result: '',
|
result: '',
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user