fis-parser-template
TypeScript icon, indicating that this package has built-in type declarations

3.1.4 • Public • Published

fis-parser-template

template.js的fis编译插件。

安装

$ npm install --save @templatejs/runtime # 安装template运行时
# $ npm install --save template_js # 也可以安装template
$ npm install -g fis-parser-template

配置

配置参数同template.js参数一样,其中global参数代表template.js的全局名称。

fis2

    //设置编译器
    fis.config.merge({
        modules: {
            parser: {
                tmpl: 'template' // tmpl后缀的使用fis-parser-template处理
            }
        }
    });
	
	//自定义参数
    fis.config.merge({
        settings: {
            parser: {
                template: {
                    sTag: '<%',
                    eTag: '%>',
                    global: 'template',
                    sandbox: false, // 沙箱模式
                }
            }
        }
    });

fis3

fis.match('**.tmpl', {
    parser: fis.plugin('template', {
        sTag: '<%',
        eTag: '%>',
        global: 'template',
        sandbox: false, // 沙箱模式
    }),
    isJsLike: true,
    release : false
});

js中如何使用

const template = require('@templatejs/runtime');
const tpl = __inline('xxx.tmpl');

const html = tpl({ /* data */ });

贡献者列表

contributors

⚙️ 更新日志

CHANGELOG.md

✈️ 计划列表

TODO.md

谁在使用

相关链接

Versions

Current Tags

Version History

Package Sidebar

Install

npm i fis-parser-template

Weekly Downloads

2

Version

3.1.4

License

MIT

Unpacked Size

12.7 kB

Total Files

12

Last publish

Collaborators

  • yanhaijing