GithubHelp home page GithubHelp logo

wxml-pretty's Introduction

wxml-pretty README

该扩展可以提供美观的wxml文件格式化。

GitHub Repo stars GitHub code size in bytes

效果图如下: 左图为美化后的代码,右边为原图

avatar

生成为 wxml 时,

  • text 文本的内容将不会进行换行,防止内容掉落。
  • 子元素有多个时,会进行换行展示,
  • 单个子元素并且为纯文本时,将不会换行展示
  • wxs 标签会检查 module 属性 和 内容的导出
  • 标签未正确闭合时,将会抛出错误

安装

直接在 vs code 插件扩展搜索 wxml-pretty,安装即可

使用

保存自动格式化默认开启,如果不需要格式化,可以在设置 -> wxml-pretty.format设置为 false。

默认的配置项如下:

{
  "wxml-pretty.format": true, // 是否开启格式化wxml
  "wxml-pretty.maxWidth": 120, // 宽度大于该值时将会换行
}

开启保存自动格式化(上方为默认选项)

Q&A

1. 保存时格式不正确

答案: 需要 选择正确的格式化工具

  1. wxml文件中,按下 ctrl + shift + P,打开命令面板
  2. 输入 format,选择 Format Document With...
  3. 选择最下方的 Configure Default Formatter...
  4. 最后选中wxml-pretty即可。

wxml-pretty's People

Contributors

ma125120 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.