はじめる

インストール

npx nuxi@latest module add nuxt-monaco-editor

monaco-editor のインストールを忘れないよう注意してください。

セットアップ

  1. モジュールをNuxtの設定に追加
export default 
defineNuxtConfig
({
modules
: [
'nuxt-monaco-editor' ] })
  1. コンポーネントを読み込む
<template>
  <MonacoEditor lang="typescript" :style="{ width: '100%', height: '100%' }"/>
</template>