This commit is contained in:
2020-08-27 22:38:51 +00:00
parent e316791841
commit 389e04812e

View File

@@ -1,5 +1,13 @@
<template> <template>
<MonacoEditor class="editor" v-model="code" language="javascript" /> <div v-resize="onResize">
<MonacoEditor
class="editor"
v-model="code"
language="javascript"
:options="monacoOptions"
:style="editStyle()"
/>
</div>
<!-- <gz-report-viewer <!-- <gz-report-viewer
:reportId="$route.params.recordid" :reportId="$route.params.recordid"
:ayaType="$route.params.ayatype" :ayaType="$route.params.ayatype"
@@ -11,7 +19,7 @@
/* Xeslint-disable */ /* Xeslint-disable */
// //
//////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////
//https://github.com/egoist/vue-monaco
import MonacoEditor from "vue-monaco"; import MonacoEditor from "vue-monaco";
const FORM_KEY = "ay-report-edit"; const FORM_KEY = "ay-report-edit";
@@ -36,6 +44,8 @@ export default {
editingActiveTranslation: false, editingActiveTranslation: false,
duplicating: false, duplicating: false,
code: "const noop = () => {}", code: "const noop = () => {}",
monacoOptions: { automaticLayout: true },
editAreaHeight: 300,
obj: {}, obj: {},
formState: { formState: {
ready: false, ready: false,
@@ -50,12 +60,22 @@ export default {
rights: window.$gz.role.defaultRightsObject(), rights: window.$gz.role.defaultRightsObject(),
ayaType: window.$gz.type.Translation ayaType: window.$gz.type.Translation
}; };
},
methods: {
onResize() {
// this.editAreaHeight = window.innerHeight / 2;
this.editAreaHeight = window.innerHeight * 0.9;
},
editStyle() {
return "height: " + this.editAreaHeight + "px;";
}
} }
}; };
</script> </script>
<style> <style>
.editor { .editor {
width: 600px; width: 100%;
height: 800px; height: 100%;
border: 1px solid grey;
} }
</style> </style>