forked from qianguyihao/Web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
qianguyihao
committed
Feb 22, 2019
1 parent
283089d
commit 1fedf3a
Showing
10 changed files
with
185 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
|
||
|
||
## 控制台的使用 | ||
|
||
### 控制台查看源码 | ||
|
||
控制台的`Sources`标签可以查看源码。按住快捷键「cmd + P」,可以根据文件名查找源码文件。 | ||
|
||
|
||
|
||
## 其他 | ||
|
||
### show user agent shadow DOM | ||
|
||
![](http://img.smyhvae.com/20180206_1610.png) | ||
|
||
|
||
![](http://img.smyhvae.com/20180206_1616.png) | ||
|
||
把上图中的红框部分打钩。 | ||
|
||
|
||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,3 +247,7 @@ export default class Movie extends React.Component { | |
|
||
2019-02-14-ReactDemo.zip | ||
|
||
## 参考链接 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
|
||
## andt 的介绍 | ||
|
||
Ant Design 是基于 React 实现,开发和服务于企业级后台产品。 | ||
|
||
### 支持环境 | ||
|
||
- 现代浏览器和 IE9 及以上(需要 polyfills)。 | ||
|
||
- 支持服务端渲染。 | ||
|
||
- [Electron](https://electronjs.org/) | ||
|
||
|
||
### 相关链接 | ||
|
||
- 官方文档:<https://ant.design/docs/react/introduce-cn> | ||
|
||
|
||
### 关于 Electron | ||
|
||
Electron(原名为Atom Shell)是GitHub开发的一个开源框架。 它允许使用Node.js(作为后端)和Chromium(作为前端)完成桌面GUI应用程序的开发。 | ||
|
||
很多客户端软件都是基于 Electron 开发的。比如 VS Code。我们打开 VS Code 菜单栏的 “帮助 --> 切换开发人员工具”,就会看到类似于 chrome的调试工具。 | ||
|
||
|
||
## andt 的使用 | ||
|
||
|
||
|
||
### 环境安装 | ||
|
||
``` | ||
npm install antd --save | ||
``` | ||
|
||
### 代码示例 | ||
|
||
我们需要什么组件,就导入该组件即可。 | ||
|
||
|
||
(1)index.html: | ||
|
||
```html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Document</title> | ||
</head> | ||
|
||
<body> | ||
<!-- 容器,通过 React 渲染得到的 虚拟DOM,会呈现到这个位置 --> | ||
<div id="app"></div> | ||
</body> | ||
|
||
</html> | ||
``` | ||
|
||
|
||
(2)main.js: | ||
|
||
```java | ||
// JS打包入口文件 | ||
// 1. 导入包 | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
|
||
import MyComponent from "./components/MyComponent.jsx"; | ||
|
||
// 使用 render 函数渲染 虚拟DOM | ||
ReactDOM.render(<MyComponent></MyComponent>, document.getElementById("app")); | ||
|
||
``` | ||
|
||
|
||
|
||
(3)MyComponent.jsx: | ||
|
||
```java | ||
import React from "react"; | ||
|
||
// 导入 日期选择组件 | ||
import { DatePicker } from "antd"; | ||
|
||
export default class MyComponent extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {}; | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<h3>在组件中引入 andt</h3> | ||
|
||
<DatePicker /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
``` | ||
|
||
|
||
代码运行效果: | ||
|
||
20190217_1500.png | ||
|
||
|
||
## AntD组件:表格 | ||
|
||
|
||
`pagination`属性可以用来分页。 | ||
|
||
|
||
### loading框 | ||
|
||
在数据显示之前,展示 loading;在数据显示之后,关闭loading。 | ||
|
||
|
||
## 相关问题的链接 | ||
|
||
- 面包屑层级显示问题:https://github.com/ant-design/ant-design-pro/issues/1584 | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters