brick-component
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

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

License

MIT

Package Sidebar

Install

npm i brick-component

Weekly Downloads

2

Version

0.3.1

License

MIT

Unpacked Size

42.5 kB

Total Files

34

Last publish

Collaborators

  • kibamaple