title: Get values from Monaco Editor in Vue 2
body: <p>I am new to Vuejs and have to integrate Vue2 with Monaco Editor.
  I want to get values input by user. I tried few ways but cannot get the value. Thanks in advance!</p>
  <p>This is my Editor.vue file.</p>
  <pre class="lang-js prettyprint-override"><code>&lt;template&gt;
    &lt;div id=&quot;editor&quot; ref=&quot;editor&quot;&gt;&lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import * as monaco from &quot;monaco-editor&quot;;
  
  export default {
    name: &quot;CodeEditor&quot;,
    mounted() {
      const editorOptions = {
        value: [
          &quot;function greeting() {&quot;,
          '\tconsole.log(&quot;Test Monaco...);',
          &quot;}&quot;,
        ].join(&quot;\n&quot;),
        language: &quot;text/javascript&quot;,
        minimap: { enabled: false },
        wordWrap: true,
        automaticLayout: true,
      };
      window.editor = monaco.editor.create(document.getElementById(&quot;editor&quot;), editorOptions);
    },
  
    computed: {   
      getUserInput() {
        // how to get user input???
      },
    },
  };
  &lt;/script&gt;
  
  &lt;style&gt;
  #editor {
    height: 500px;
    width: 100%;
    overflow: hidden;
  }
  &lt;/style&gt;
  </code></pre>