React環境搭建之一:sublime編輯器

來源:互聯網
上載者:User

1. 下載並安裝sublime text3

https://www.sublimetext.com/3


2. 安裝package control外掛程式

這個外掛程式用來安裝其他外掛程式的。

參考官網連結說明,進行安裝:https://packagecontrol.io/installation


3. 用package controle: install package 安裝:babel, React-JS, sublimeLinter

4. 按安裝 emmet,並修改emmet 相容jsx檔案

開啟 preferences -> Key bindings - Users,把下面代碼複製到[]內部。

 {      "keys": [        "super+e"      ],      "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      }]    }

5. 安裝JS,格式化js代碼

開啟preferences -> Package Settings -> JsFormat -> Setting - Users,輸入以下代碼:

{  "e4x": true,  // jsformat options  "format_on_save": true,}

即可儲存時自動格式化,並支援 jsx 類型檔案.





參考連結:

http://www.cnblogs.com/terrylin/p/4942332.html


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.