Intact

可继承,强逻辑模板的前端开发框架

简单

没有复杂的概念,你仅仅只需要了解HTML,CSS和JavaScript即可

高效

22KB min+gzip 大小,包含前端编译模块;
fork自目前最快的虚拟DOM引擎之一(inferno)构建

可继承,强逻辑模板

充分发挥继承的优势,实现组件逻辑和模板的继承扩展, 让你更快速方便地构建复杂的应用

通过继承的思想,来扩展父组件逻辑和模板。同时组件数据变更,界面会立即自动做出相应更新

// @file layout.vdt
<div>
    <header>
        <b:header>Extendable and Reactive Component</b:header>
    </header>
    <div>
        <b:body>
            <div class="count">{self.get("count")}</div>
        </b:body>
    </div>
</div>
// @file layout.js
import Intact from 'intact';
import template from './layout.vdt';

export default class Layout extends Intact {
    @Intact.template()
    static template = template;

    defaults() {
        return {count: 0};
    }
}
// @file page.vdt
<t:parent>
    <b:body>
        {parent()}
        <button class="button"
            ev-click={self.add}
        >Click me!</button>
    </b:body>
</t:parent>
// @file page.js
import Intact from 'intact';
import template from './page.vdt';
import Layout from './layout';

export default class Page extends Layout {
    @Intact.template()
    static template = template;

    add() {
        this.set('count', this.get('count') + 1);
    }
}


Intact.mount(Page, document.getElementById('app'));
Extendable and Reactive Component
0