{"id":18722017,"url":"https://github.com/realign/fozy-menu","last_synced_at":"2025-11-11T04:30:15.929Z","repository":{"id":57241161,"uuid":"110644202","full_name":"ReAlign/fozy-menu","owner":"ReAlign","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-16T14:53:00.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T09:39:02.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ReAlign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-14T05:20:17.000Z","updated_at":"2018-03-16T14:53:01.000Z","dependencies_parsed_at":"2022-09-07T23:12:58.057Z","dependency_job_id":null,"html_url":"https://github.com/ReAlign/fozy-menu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReAlign%2Ffozy-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReAlign%2Ffozy-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReAlign%2Ffozy-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReAlign%2Ffozy-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReAlign","download_url":"https://codeload.github.com/ReAlign/fozy-menu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239587243,"owners_count":19663892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T13:39:22.537Z","updated_at":"2025-11-11T04:30:15.872Z","avatar_url":"https://github.com/ReAlign.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fozy-menu\n\n[![NPM version][npm-image]][npm-url]\n\n[npm-url]: https://www.npmjs.com/package/fozy-menu\n[npm-image]: https://img.shields.io/npm/v/fozy-menu.svg\n\n## 简介\n\n\u003e fozy 多份配置数据转换\n\n使用 `fozy` 来 `mock` 数据，需要维护 `fozy config` \u0026 `同步数据` \u0026 `...` 等实际内容大致相同的数据。\n\n但是实际情况是，这几套数据，除了形式上的不一致，主要内容几乎是一样的，多人协作开发，很难有人完全去维护多份数据。\n\n所以，想通过工具，进行格式上的转化，开发者只需要维护一份（必要、非维护不可）数据即可。\n\n## Usage\n\n```javascript\nlet FozyMenu = require('fozy-menu');\n```\n\n#### init(pageList, listKey)\n\u003e 默认从 list 初始化 fozy 配置\n\n####  menu(pageList, opt)\n\u003e 默认从 list 初始化 menu 配置\n\n```javascript\nFozyMenu.init(pageList, listKey);\nFozyMenu.menu(pageList, opt);\n\npageList = [\n    {\n        type: 'index',\n        name: '首页',\n        id: -1,\n        list: [\n            {id: -101, name: '首页', url: '/', path: './index.ftl'}\n        ]\n    },\n    {\n        type: 'manage',\n        name: '管理',\n        id: 1,\n        list: [\n            {id: 101, name: '查询', url: '/query.do', path: './query.ftl'},\n            {id: 102, menu: false, name: '详情页', url: '/detail.do', path: './detail.ftl'}\n        ]\n    }\n];\n\nlistKey = 'list';\n\nopt = {\n    childrenKey: 'childsList',\n    listKey: 'list'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealign%2Ffozy-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealign%2Ffozy-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealign%2Ffozy-menu/lists"}