rhino-ext-runtime
TypeScript icon, indicating that this package has built-in type declarations

0.1.32 • Public • Published

扩展点运行时 SDK

安装

> tnpm i rhino-ext-runtime -S

开始使用

import ExtRuntime from 'rhino-ext-runtime';
import { BasePagePlugin, RhinoSchemaHelpers } from 'rhino-ext-runtime';

// 初始化一个运行时实例
const extRuntime = new ExtRuntime();

// 设置扩展应用加载启用逻辑
extRuntime.setDetector(({ data, pageInfo }) => [
  {
    appPath: 'cdn.com',
    pages: [
      'pageFolderName1',
      'pageFolderName2',
    ]
  }
]);

// 获取用户配置的字段信息
const { fieldsConfig, blocksConfig } = await extRuntime.declareFields();

// 声明扩展点
const result = await extRuntime.declareHook('myHookName', { data });

// 更新表格某一行的组件信息
const modifiedArrayItemData = ExtRuntime.RhinoSchemaHelpers.updatePropsOfArrayItem(
  {
    arrayItemData: data
    fieldsConfig: [
      {
        fieldCode,
        blockCode,
        props: {
          foo: 'abc',
          bar: 'efg'
        },
      }
    ]
  }
);

Readme

Keywords

none

Package Sidebar

Install

npm i rhino-ext-runtime

Weekly Downloads

3

Version

0.1.32

License

none

Unpacked Size

34.9 kB

Total Files

14

Last publish

Collaborators

  • lpgray