1.0.5 • Published 8 years ago

fis3-preprocessor-rjy-template v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

fis3-preprocessor-rjy-template

模版状态及数据渲染解决方案。

标准化前,对模板打标记并可以包装html。 与fis3-postprocessor-rjy-template配合使用。

npm install fis3-preprocessor-rjy-template -g

fis-conf.js中使用

fis.match('**.html', {
    preprocessor: fis.plugin('rjy-template',{
    	wrapHtml:true,
		headTemplate:"/components/head/head.tpl"
    })
});

##模板页中

tmpl-data可以通过以下方式传递数据: 1. 可以作为简单的状态值使用text=string 2. 当数据较为复杂是,可以通过url=path/to/your.json的方式引用json格式的文件,支持相对路径和绝对路径 3. 选择复杂数据的某个属性以.分割父子属性

<!-- 简单状态 -->
<link rel="import" href="a.tpl?__inline" tmpl-data="text=a">
<!-- 复杂数据结构 -->
<link rel="import" href="b.tpl?__inline" tmpl-data="url=path/to/your.json&id=b.info">

##配置

  • wrapHtml 是否开启包装html的功能(目前只支持html5的声明),默认false
  • headTemplate 模板<head>的路径,暂时不支持数据渲染功能

##待开发

  • 需要支持默认数据引用规则
  • 增加包装html相关配置
1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago