Skip to content
eprom2006 edited this page Feb 10, 2020 · 14 revisions

Welcome to the thin.js wiki!

一个羽量级的前端框架,基于html5+css3+jquery。

开始使用

  • 添加对jquery的引用,thinjs.com上的版本为3.4.1,你也可以从其他源引用jquery。
<script src="http://thinjs.com/jquery.js"></script>
  • 添加对 thin.js的引用。
<script src="http://thinjs.com/thin.min.js"></script>
  • 如果你用到render以外的其他功能,还需要添加对thin.css的引用。(可选)
<link rel="stylesheet" href="http://thinjs.com/thin.css">
  • 使用渲染器
$(selector).render({
        data:data,
        template:template
});

render 渲染器

  1. 基本语法
  2. 模板
  3. element 模板
    1. 控制样式
    2. 使用数据
    3. 处理事件
    4. 生成元素属性
  4. if 结构
  5. switch case 结构
  6. foreach 结构

poplayer 弹出层

弹窗渲染器

tab 标签

multiview 多视图