Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting language doesn't work #142

Closed
duncanmcclean opened this issue Nov 30, 2020 · 1 comment
Closed

Setting language doesn't work #142

duncanmcclean opened this issue Nov 30, 2020 · 1 comment

Comments

@duncanmcclean
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant