[Improvement] Reorganize demos (#1052)

This commit is contained in:
neverland
2018-05-12 15:22:37 +08:00
committed by GitHub
parent a55eda8891
commit 4de1e7da55
83 changed files with 109 additions and 113 deletions
+1 -5
View File
@@ -48,7 +48,7 @@ vant
- 添加 Vue 代码
以添加新组件 `Button` 为例,首先在 `packages` 目录下新建目录 `button`,用 `index.js` 或者 `index.vue` 文件做为组件入口,需要的话可以建其他文件来组织代码。
以添加新组件 `Button` 为例,首先在 `packages` 目录下新建目录 `button`,用 `index.js` 或者 `index.vue` 文件做为组件入口,需要的话可以建其他文件来组织代码。测试代码放在组件目录下的 `test` 文件夹中,示例代码放在组件目录下的 `demo` 文件夹中。
- 添加样式代码
@@ -60,10 +60,6 @@ vant
新组件的文档编写,需要在 `docs/markdown` 下各个语言中新建对应同名文档 `button.md`,在 `docs/demos` 下创建组件示例,并在 `docs/src/doc.config.js` 中进行配置组件名称
- 添加测试代码
需要在 `test/specs` 目录下增加对应组件的测试文件,以 .spec.js 结尾,如:`button.spec.js`。测试框架使用了 karma + mocha + sinon + chaivue 相关的操作使用了 [avoriaz](https://github.com/eddyerburgh/avoriaz)
## 组件文档如何编写