Skip to content

Commit e846b27

Browse files
committed
update
1 parent 835f94a commit e846b27

File tree

7 files changed

+60
-1
lines changed

7 files changed

+60
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,4 @@ Network Trash Folder
8787
Temporary Items
8888
.apdisk
8989

90+
.idea

AMD/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="width=device-width, initial-scale">
6+
<title>Document</title>
7+
</head>
8+
<body>
9+
<p>AMD test</p>
10+
<script data-main="./js/main.js" src="https://cdn.bootcss.com/require.js/2.3.3/require.min.js"></script>
11+
</body>
12+
</html>

AMD/js/a.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
define(['./a_util.js'],function (aUtil) {
2+
var a = {
3+
printDate: function (date) {
4+
console.log(aUtil.aGetFormatDate(date));
5+
}
6+
}
7+
return a
8+
})

AMD/js/a_util.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
define(['./util.js'],function (util) {
2+
var aUtil ={
3+
aGetFormatDate:function (date) {
4+
return util.getFormatDate(date,2)
5+
}
6+
}
7+
return aUtil
8+
})

AMD/js/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require(['./js/a.js'],function (a) {
2+
var date = new Date();
3+
a.printDate(date);
4+
})

AMD/js/util.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
define(function () {
2+
var util = {
3+
getFormatDate:function (date,type) {
4+
if (type === 1) {
5+
return '2017-8-6'
6+
}else if (type === 2) {
7+
return '2017年8月6日'
8+
}
9+
}
10+
}
11+
return util
12+
})

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* [08-02](https://github.com/TYRMars/JSlearn#08-02) `JavaScript算法-冒泡排序`
5050
* [08-03](https://github.com/TYRMars/JSlearn#08-03) `JavaScript算法-选择排序`
5151
#### 09 函数应用
52-
* [09-01](https://github.com/TYRMars/JSlearn#09-01) `JavaScript算法测试函数`
52+
* [09-01](https://github.com/TYRMars/JSlearn#09-01) `函数应用`
5353

5454
---
5555

@@ -1575,6 +1575,20 @@ module.exports = {
15751575
* 需要异步加载JS,使用AMD
15761576
* 使用了npm之后建议使用CommonJS
15771577

1578+
## 06-04
1579+
### Git
1580+
#### 常用命令
1581+
* `git init`git初始化
1582+
* `git add .`文件新增
1583+
* `git checkout XXX`出错还原
1584+
* `git commit -m "XXX"`commit提交到本地仓库 后面为注释
1585+
* `git push origin master` 代码上传
1586+
* `git pull origin master` 代码下载
1587+
##### 多人开发
1588+
* `git branch`看当前分支
1589+
* `git checkout -b xxx/git checkout xxx`创建一个分支/切换分支
1590+
* `git merge xxx`分支更改的东西提交到master或者分支
1591+
15781592
## 07-01
15791593
### 上线回滚-上线回滚流程
15801594
* 上线和回滚的基本流程

0 commit comments

Comments
 (0)