小程序模板网

atom 支持微信小程序开发环境

发布时间:2018-04-17 09:26 所属栏目:小程序开发教程

作者:weekeight,来自原文地址 
相关跳坑指南:跳坑《一百五十一》使用第三方编辑器(IDE)开发 
在使用 atom 作为微信小程序开发 IDE 时,由于微信小程序的模板文件拓展名为 .wxml 和样式文件名为 .wxss,使得 atom 无法识别语法做代码高亮,更不能使用 emmet 插件进行补全。

支持语法高亮

 

  1. // 在 config.cson 里 `core` 配置下添加 `customFileTypes` 配置即可支持 .wxml 和 .wxss 的语法高亮
  2. core:
  3. customFileTypes:
  4. 'text.html.mustache': [
  5. 'wxml'
  6. ]
  7. 'source.css': [
  8. 'wxss'
  9. ]

emmet tab 快捷键支持 .wxml 补全

 

  1. // emmet 要先识别当前文件的语法格式才能做自动拓展,故必须先完成上面步骤让 atom 能识别 wxml 语法才行
  2. // 在 keymap.cson 中添加如下配置即可
  3. 'atom-text-editor[data-grammar="text html mustache"]:not([mini])':
  4. 'tab': 'emmet:expand-abbreviation-with-tab'

参考链接:

http://flight-manual.atom.io/using-atom/sections/basic-customization/#customizing-language-recognition



易优小程序(企业版)+灵活api+前后代码开源 码云仓库:starfork
本文地址:https://www.eyoucms.com/wxmini/doc/course/23504.html 复制链接 如需定制请联系易优客服咨询:800182392 点击咨询
QQ在线咨询