0.1.4 • Published 5 years ago

xext v0.1.4

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

xext

喧喧扩展开发辅助模块,包含 TypeScript 定义。

使用方法

1. 安装模块

npm install xext --save

2. 导入 xext 模块

import xext, {
  DEBUG,
  lang,
  nodeModules,
  views,
  components,
  utils,
  platform,
  app
} from 'xext';

3. 使用示例

编写应用扩展 React 组件模块 app.ts

import {React, ReactDOM} from 'xext';

export default (props: any) => {
    const {app} = props;
    return <div className="red box">Hello: {app.name}</div>
};

编写扩展模块:

import xext, {DEBUG} from 'xext';
import AppView from './app';

const extension: ExtensionModule = {
    onAttach(ext: Xuanxuan.Extension) {
        if (DEBUG) {
            console.log(`Extension '${ext.displayName}' loaded from ${ext.mainFile}.`);
        }
    },
    MainView: AppView
};

export default extension;
0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago