Emmet in JS files
The latest post on this is > 4 years old and (that mentions something about using "Harmony") I believe Intellij has has incorporated emmet expansion capabilities natively with jsx, html, and css files since?
I'm pretty sure I've done this before, but I can't find any settings specific to enabling emmet in js files. How would I do this?
请先登录再写评论。
Emmet in JSX is supported. Please make sure that Enable JSX Emmet is ticked in Settings | Editor | Emmet | JSX
Thanks, but that's not my question. I'm using .js files to write my jsx code and would like to use emmet notation from .js files.
and what's a problem? JSX emmet works in .js files - you just need to make sure that javascript language version is set to React JSX to get JSX syntax accepted
Oh... I bet that may be it. Sorry about that. My setup here at work works fine. I bet I haven't properly defined my javascript compatibility properly on my home system. I'll try it later today. Thanks!
I've enabled this in the settings, however it only works on html section but not the <script> section of html file. Is it possible to enable it on the whole html page? Because often time we construct html fragment in Javascript code.
What does your <script> section look like? Please attach screenshots
screenshot for the html section, it worked correctly.
Screenshot for the script section, Emmets doesn't work.
HTML is not auto-injected in template string, so you can't expect HTML Emmet to work there. You need to inject HTML in your template to make this work, like
Thanks. This works for that template string.
It doesn't show preview though. Also need the inject for reach template string. Is there a way to inject once and works for the whole file?
>It doesn't show preview though
Works for me:
what IDE version do you use?
>Is there a way to inject once and works for the whole file?
No, it can't be set on file level
I'm using IntellijJ IDEA Ultimate 2018.2
That's the issue - Emmet preview in injections only works since 2018.3 (https://youtrack.jetbrains.com/issue/WEB-29360)