Setting language doesn't work
duncanmcclean opened this issue · 1 comments
duncanmcclean commented
I'm having issues when I try to set the language of the editor as a prop... here's the code I'm using:
<MonacoEditor
v-if="view.currentTab === 'template'"
theme="vs-dark"
language="html"
:value="request.template"
:options="options"
@change="onTemplateChange"
>
Everything works apart from setting a language
as a prop. I've also tried setting it in the options
data array but that didn't work either.
You can see my full code here where I'm using the Monaco Editor.
duncanmcclean commented
I've fixed it, basically my syntax highlighting wasn't working properly. I had to install monaco-editor-webpack-plugin@1.8.2
and add the following to my Webpack/Laravel Mix config:
plugins: [
new MonacoWebpackPlugin({
languages: [
'html',
'yaml',
],
}),
],
And like magic... the syntax highlighting all started to work perfectly.