Closed wspl closed 6 years ago
Solution: import editor by require on mounted
method
<template>
<div class="dev page">
<div class="editor">
<div class="editor container" ref="editor"></div>
</div>
</div>
</template>
<script>
// import * as monaco from '@timkendrick/monaco-editor'
export default {
layout: 'project',
name: 'dev-page',
async mounted() {
const monaco = require('@timkendrick/monaco-editor')
console.log(this.$refs.editor )
const editor = monaco.editor.create(this.$refs.editor, {
value: `console.log('hello world')`,
language: 'javascript'
})
console.log(editor)
}
}
</script>
Here are my vue component code: