tickplate

2019-10-09 admin

tickplate是什么

什么是tickplate,Back-tick templates for JavaScript

tickplate使用教程帮助文档

Tickplate - Back-tick templates for JavaScript

TravisCI Codacy Badge NPM Version NPM Downloads/Month NPM Downloads

Usage

  • Install: npm install tickplate
  • Require: const t = require('tickplate');
  • Place tag t before templated string

Examples:

const t = require('tickplate');

const data = {
  hello: 'Ave!',
  myFriend: {
    name: 'Marcus Aurelius',
    toString() {
      return this.name;
    },
  },
  positions: ['imperor', 'philosopher', 'writer'],
};

const templ = t`Example: ${'hello'} ${'myFriend'} great ${'positions'} of Rome`;

console.log(templ(data));

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-76947.html

文章标题:tickplate

回到顶部