https://github.com/one-programmer/op-d2-scaffolding
https://github.com/one-programmer/op-d2-scaffolding
d2-admin element-ui scaffolding vue
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/one-programmer/op-d2-scaffolding
- Owner: one-programmer
- Created: 2018-09-01T06:39:31.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-18T03:18:58.000Z (over 7 years ago)
- Last Synced: 2025-04-04T19:50:56.693Z (about 1 year ago)
- Topics: d2-admin, element-ui, scaffolding, vue
- Language: HTML
- Size: 25.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# D2 脚手架
## 安装
```bash
sudo npm install https://github.com/one-programmer/op-d2-scaffolding.git -g link
```
## 如何使用
```bash
$ op-crud -h
Usage: op-crud [options]
Options:
-V, --version output the version number
-n, --name name
-t, --title 标题
-f, --filePath file path
-h, --help output usage information
```
```bash
op-crud -n todos -t TODO -f /path/xxx.json
```
## JSON数据格式
- key 字段名
- name 中文含义
- type 类型 [number|string|datetime|boolean|image|file]
- choices 选项
- read 是否可读(默认在列表中展示)
- write 是否可写(默认在编辑/新装中展示)
```json
[
{
"key": "id",
"name": "ID",
"type": "number",
"read": true,
"write": false
},
{
"key": "title",
"name": "标题",
"type": "string",
"read": true,
"write": true
},
{
"key": "price",
"name": "价格",
"type": "number",
"read": true,
"write": true
},
{
"key": "description",
"name": "描述",
"type": "string",
"read": true,
"write": true
},
{
"key": "created_at",
"name": "创建时间",
"type": "datetime",
"read": true,
"write": false
},
{
"key": "updated_at",
"name": "生效时间",
"type": "datetime",
"read": true,
"write": true
}
]
```