Integrate monaco-editor with Nuxt
npx nuxi@latest module add nuxt-monaco-editor
Don't forget to install monaco-editor
.
export default defineNuxtConfig({
modules: [
'nuxt-monaco-editor'
]
})
export default defineNuxtConfig({
monacoEditor: {
// These are default values:
locale: 'en',
componentName: {
codeEditor: 'MonacoEditor',
diffEditor: 'MonacoDiffEditor'
}
}
})
<template>
<MonacoEditor v-model="value" lang="typescript" />
</template>
<script lang="ts" setup>
const value = ref('')
</script>
npm run dev:prepare
to generate type stubs. npm run dev
to start playground in development mode.