$ npm i -s monaco-editor-vue-component
Register the component:
import MonacoPlugin from 'monaco-editor-vue-component'
const app = createApp(App)
app.use(MonacoPlugin)
app.mount('#app')
Use the component:
<script setup>
import { ref } from "vue";
const sourceCode = ref('// Welcome')
</script>
<template>
<monaco v-model="sourceCode" fontSize="14pt" theme="vs" language="javascript"/>
<monaco v-model="sourceCode" :editorOptions="{ fontSize: '14pt', theme: 'vs', language='javascript' }"/>
</template>