NicholasNC
V2EX  ›  问与答

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

  •  
  •   NicholasNC · Jun 26, 2016 · 5717 views
    This topic created in 3608 days ago, the information mentioned may be changed or developed.

    希望可以让 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
      }]
    }]
    
    1 replies    2016-06-28 11:28:39 +08:00
    NicholasNC
        1
    NicholasNC  
    OP
       Jun 28, 2016
    不是很懂,今天卸掉了 Emmet ,然后重新安装。
    神奇的居然可以了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1253 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 17:34 · PVG 01:34 · LAX 10:34 · JFK 13:34
    ♥ Do have faith in what you're doing.