V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
NicholasNC
V2EX  ›  问与答

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

  •  
  •   NicholasNC · 2016-06-26 17:41:29 +08:00 · 5124 次点击
    这是一个创建于 2870 天前的主题,其中的信息可能已经有所发展或是发生改变。

    希望可以让 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 条回复    2016-06-28 11:28:39 +08:00
    NicholasNC
        1
    NicholasNC  
    OP
       2016-06-28 11:28:39 +08:00
    不是很懂,今天卸掉了 Emmet ,然后重新安装。
    神奇的居然可以了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2744 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 14:34 · PVG 22:34 · LAX 07:34 · JFK 10:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.