https://github.com/mipengine/mip-by-example
MIP 组件示例
https://github.com/mipengine/mip-by-example
Last synced: 5 months ago
JSON representation
MIP 组件示例
- Host: GitHub
- URL: https://github.com/mipengine/mip-by-example
- Owner: mipengine
- Created: 2019-03-20T08:57:31.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-20T08:58:33.000Z (almost 7 years ago)
- Last Synced: 2025-01-10T21:32:50.405Z (about 1 year ago)
- Language: CSS
- Size: 2.76 MB
- Stars: 0
- Watchers: 18
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MIP by Example
MIP 组件丰富的使用示例展示。
## 创建新示例
* 在 `example` 目录对应的组件类型中新建页面
```
vim examples/layout/mip-test.html
```
* `npm run dev`
* 实时预览示例编写 `http://0.0.0.0:18080/`
## 编写新示例
示例说明部分使用 HTML 注释 ``` ,内容使用 markdown 格式
* 二级标题会渲染为右侧目录
* 必须包括 `## 组件介绍` 小节,第一句用于生成组件描述,建议第一句简洁说明组件作用
```html
```
示例 code 部分直接使用 HTML tag,用于渲染示例代码和示例展示。
```html
```
* 如果组件仅适用移动端展示,可在示例 DOM 上添加 `data-strategy="mobile-only"`。
```html
```
如果组件需要 server 进行 api mock,项目提供基于 express 搭建的 server。可在 `src/routes `中创建和编写路由文件,并在 `src/routes/index.js` 中进行路由 register(建议文件和路由均以组件名命名)