brick-component
v0.3.1
Published
brick component for engine
Downloads
1
Maintainers
Readme
brick-component
基于brick-engine的组件化工具包.提供简便的组件定义与组件依赖模块注入.
Install
npm install --save brick-component
Usage
Setup
const {defineApplication} = require('brick-engine');
const {componentSetup} = require('brick-component');
const app = {};
componentSetup(app);
defineApplication(exports, app);
Component
const {defineComponent, defineComponentProperty} = require('brick-component');
class Component {
getMethod(){
return this.field1;
}
}
/* 定义组件 */
defineComponent(Component);
/* 定义组件依赖属性 */
defineComponentProperty(Component, { name: 'field1', dep: { id: 'depId' } });
exports.Component = Component;
Documentations
使用jsdoc
生成注释文档
git clone https://github.com/kiba-zhao/brick-component.git
cd brick-component
npm install
npm run docs
open docs/index.html