Skip to content

Commit

Permalink
snippets仓库接入
Browse files Browse the repository at this point in the history
  • Loading branch information
FateRiddle committed Apr 16, 2021
1 parent f8dccf4 commit d4a86ad
Show file tree
Hide file tree
Showing 7 changed files with 748 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/form-render-snippets/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md
7 changes: 7 additions & 0 deletions tools/form-render-snippets/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Change Log

All notable changes to the "form-render-snippets" extension will be documented in this file.

## [1.0.0]

- Initial release
25 changes: 25 additions & 0 deletions tools/form-render-snippets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# FormRender snippets

快速撰写 [FormRender](https://github.com/alibaba/form-render)的模板的利器。

![](https://img.alicdn.com/imgextra/i4/O1CN01NP0URk20yx3JiuYng_!!6000000006919-2-tps-2188-1180.png)

如图,在 .json 文件中输入关键词 `fr` 即可查阅所有的快捷 snippets。其中 `fr-init` 会生成如下的骨架:

```json
{
"type": "object",
"properties": {},
"required": []
}
```

然后在骨架中使用元素 snippets 撰写所有的表单项吧,例如需要一个列表则使用 `fr-list` ,如果需要下拉单选框则使用 `fr-select` ,等等。

snippets 基本分为三类:

1. 生成一个表单元素的 schema (例如输入框,多选框,列表,对象)
2. 生成部分常用选项的 schema(例如 ui:options, ui:width, format 等)
3. 生成骨架和 demo。fr-init 生成骨架,fr-demo 生成一个包含所有可用组件以及一个联动显隐的样例

注意不需要输入完整的 `fr-number-complex `来唤起一个 snippet 哦,只需要输入 `number` 或者甚至 `fnc` 就能智能联想了。
Binary file added tools/form-render-snippets/fr-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions tools/form-render-snippets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "form-render-snippets",
"displayName": "FormRender snippets",
"description": "quick way to write form-render schema",
"version": "1.1.1",
"icon": "fr-icon.png",
"repository": {
"type": "git",
"url": "https://github.com/FateRiddle/form-render-snippets"
},
"scripts": {
"login": "vsce login fateriddle",
"release": "vsce publish"
},
"publisher": "fateriddle",
"engines": {
"vscode": "^1.41.0"
},
"categories": [
"Snippets"
],
"contributes": {
"snippets": [
{
"language": "json",
"path": "./snippets/snippets.json"
},
{
"language": "javascript",
"path": "./snippets/snippets.json"
},
{
"language": "markdown",
"path": "./snippets/snippets.json"
}
]
}
}
Loading

0 comments on commit d4a86ad

Please sign in to comment.