怎样使 sublime 可以自动补全 jsx 的标签,使用 Emmet 的一些误区

2016-06-26 17:41:29 +08:00
 NicholasNC

希望可以让 sublime 自动补全jsx 标签,如下图

但是参考了Sublime3 玩转 ES6+ReactJs里面配置 Emmet 的做法,没有起到效果

菜单->Preferences->Key Bindings - User是这样的:

[{
  "keys": [
    "tab"
  ],
  "args": {
    "action": "expand_abbreviation"
  },
  "command": "run_emmet_action",
  "context": [{
    "key": "emmet_action_enabled.expand_abbreviation"
  }]
}, {
  "keys": ["tab"],
  "command": "expand_abbreviation_by_tab",
  "context": [{
    "operand": "source.js",
    "operator": "equal",
    "match_all": true,
    "key": "selector"
  }, {
    "key": "preceding_text",
    "operator": "regex_contains",
    "operand": "(\\b(a\\b|div|span|p\\b|button)(\\.\\w*|>\\w*)?([^}]*?}$)?)",
    "match_all": true
  }, {
    "key": "selection_empty",
    "operator": "equal",
    "operand": true,
    "match_all": true
  }]
}]
5140 次点击
所在节点    问与答
1 条回复
NicholasNC
2016-06-28 11:28:39 +08:00
不是很懂,今天卸掉了 Emmet ,然后重新安装。
神奇的居然可以了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/288422

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX