@lx-frontend/node-app-maps
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

lx-app-maps

解析页面配置,生成对应 plantuml 配置,可视化展示页面跳转关系图。

Usage

// 这个数据为 @lx-frontend/router-params-validator 包所需要的路由配置数据
const routeMaps = require('./routeMaps');
const {Maps} = require('../lib');

const map = new Maps({
  title: '立新车市',
  routeMaps,
});

const pumlTemplate = map.build();
//
console.log(pumlTemplate);

数据说明

  1. 路由数据是一个对象,key 是去向页面(唯一),如果 key 有值,则说明有来路,value 是来路页面对象(多个)

  2. 来路页面其实就是 jsonschema 对象,举例

     {
       "type": "object",
       "properties": {},
       "required": []
     }
  3. 一个完整 routeMaps 举例:

const routeMaps = {
  // 去向页面1
  "pages/tab/home": {
    // 去向页面1,来路1
    "立新车市": {
      "type": "object",
      "properties": {},
      "required": []
    }
  },
  // 去向页面2
  "pages/tab/my": {
    // 去向页面2,来路1
    "立新车市": {
      "type": "object",
      "properties": {},
      "required": []
    }
  },
  // 去向页面3
  "pages/session/list": {
    // 去向页面3,来路1
    "pages/tab/home": {
      "type": "object",
      "properties": {
        "id": 1,
        "region": "lixin"
      },
      "required": [
        "id"
      ]
    }
  }
}

效果展示

效果展示

Readme

Keywords

none

Package Sidebar

Install

npm i @lx-frontend/node-app-maps

Weekly Downloads

0

Version

0.1.1

License

ISC

Unpacked Size

409 kB

Total Files

15

Last publish

Collaborators

  • ruqimobile
  • haiyulu
  • erica.liuyj
  • pok.h
  • chenzian
  • azumia
  • jeely
  • lichao.franklee
  • mind29
  • yuki.liu
  • lixinleon
  • frontbot
  • owen.huang
  • tiny.tu
  • simba.wang