首页 > 解决方案 > Intellij 通过插件向 html 标签添加标准属性

问题描述

在 IntelliJ 中,

当我键入<in它时,它会自动向我建议<input>-field。如果我按 Tab/Enter,我会得到建议的内容。
我来自 atom 用于前端的东西,如果你在那里按 enter,你会得到input具有基本属性的字段,如下所示:

<input type="" name="" value="">

是否有用于 intellij 的插件/设置来做同样的事情?
我已经在使用实时模板/编辑,这似乎不起作用。

标签: intellij-ideapluginsintellij-plugin

解决方案


不要输入左尖括号,只需输入in,点击Ctrl+Space,然后从完成列表中选择input Emmet live template。默认情况下,它将展开为,但您可以在设置 |<input type="text">中更改input实时模板。编辑 | Live Templates、Zen HTML添加更多预定义属性,例如:

<input type="$VAR0$" name="$NAME$" value="$VALUE$">

推荐阅读