zoukankan      html  css  js  c++  java
  • sublime3 支持 jsx 语法

    添加几个插件即可在js中快速写html

    babel

    可以识别React,并高亮显示ES6

    command+shift+p -> install package -> babel

    使用

    在打开js、jsx文件时,右下角选择babel JavaScript(Babel)

    Emmet

    command+shift+p -> install package -> emmet

    配置

    打开菜单Preferences -> Package Settings -> Emmet -> Key Bindings - User

    粘贴以下代码

    [{
        "keys": ["tab"],
        "command": "expand_abbreviation_by_tab",
    
        // put comma-separated syntax selectors for which 
        // you want to expandEmmet abbreviations into "operand" key 
        // instead of SCOPE_SELECTOR.
        // Examples: source.js, text.html - source
        "context": [{
                "operand": "source.js",
                "operator": "equal",
                "match_all": true,
                "key": "selector"
            },
    
            // run only if there's no selected text
            {
                "match_all": true,
                "key": "selection_empty"
            },
    
            // don't work if there are active tabstops
            {
                "operator": "equal",
                "operand": false,
                "match_all": true,
                "key": "has_next_field"
            },
    
            // don't work if completion popup is visible and you
            // want to insert completion with Tab. If you want to
            // expand Emmet with Tab even if popup is visible -- 
            // remove this section
            {
                "operand": false,
                "operator": "equal",
                "match_all": true,
                "key": "auto_complete_visible"
            }, {
                "match_all": true,
                "key": "is_abbreviation"
            }
        ]
    }]
    

    jsformat

    command+shift+p -> install package -> jsformat

    配置

    打开菜单Preferences -> Package Settings -> JsFormat -> Settings - User,将下面代码贴进去保存。

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

    该配置会在每次保存js文件时,自动格式化

  • 相关阅读:
    task打印执行结果
    九宫格----记网易游戏2015年研发类笔试题
    第一篇博客
    http超时机制
    SVN错误解决办法
    FFmpeg源码编译
    闲来无事——第一弹 Java基础 基本数据类型
    一个比较好的图标搜索网站
    JS 跑马灯
    Jquery
  • 原文地址:https://www.cnblogs.com/zhangceblogs/p/8310551.html
Copyright © 2011-2022 走看看