JSPM

  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q45983F
  • License MIT

指令类型模板引擎

Package Exports

  • blear.classes.template

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (blear.classes.template) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

blear.classes.template 指令类型模板引擎

npm module build status coverage

文本声明

变量定义、赋值

{{#set abc = 123}}
{{#set abc = 456}}

忽略编译

{{#ignore}}
.....
{{/ignore}}

判断

{{#if exp}}
{{#else if exp}}
{{#else}}
{{/if}}

循环

{{#for index, item in list}}
{{/for}}

取消编译

\\{{exp}} => {{exp}}

属性指令

属性里的表达式不会进行 escape

循环

<li @for="key, val in item"></li>

判断

<li @if="exp"></li>

属性

@style="font-size: fontSize + 'px'; width: width + 'px'"
@class="class-a: classA, class-b: classB"
```

## 输出
```
转义输出 {{exp}}
原样输出 {{=exp}}
```