mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
37 lines
738 B
Vue
37 lines
738 B
Vue
<template>
|
|
<monaco-editor ref="editorRef" v-model="json" :language="language" height="200px" check />
|
|
{{ json }}
|
|
</template>
|
|
<config>
|
|
{
|
|
"name": "editor",
|
|
"title": "$editor",
|
|
"keep-alive": true
|
|
}
|
|
</config>
|
|
<script>
|
|
import { onMounted, ref } from 'vue';
|
|
import { MonacoEditor } from '@fesjs/fes';
|
|
|
|
export default {
|
|
components: {
|
|
MonacoEditor,
|
|
},
|
|
setup() {
|
|
const editorRef = ref();
|
|
const json = ref('');
|
|
const language = ref('json');
|
|
onMounted(() => {
|
|
setTimeout(() => {
|
|
language.value = 'html';
|
|
}, 3000);
|
|
});
|
|
return {
|
|
editorRef,
|
|
json,
|
|
language,
|
|
};
|
|
},
|
|
};
|
|
</script>
|