-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
55 lines (45 loc) · 1.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!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>Hello common tools</title>
</head>
<body>
<!-- element start -->
<div id="app"></div>
<!-- element end -->
<script src="./dist/app.js"></script>
<script>
// 日期相关功能测试 start =========================
const cDate1 = new cTools.Date();
console.log( cDate1.format(new Date()) );
console.log( cDate1.format(new Date(), 'yyyy') );
console.log( cDate1.format(new Date(), 'dd-MM-yyy hh:mm:ss') );
// 日期相关测试 end =========================
// `document` 相关功能测试 start =========================
// rem 设置
cTools.Doc.setRem(640);
// `document` 相关功能测试 end =========================
// `window` 相关功能测试 start =========================
const localStorage_cTools = cTools.Win.localStorage;
localStorage_cTools.setLocal('IS_LOGIN', true);
const localValue = {
name: '张三',
avatar: '//xxxxx.xxx.png'
}
localStorage_cTools.setLocal( '', localValue);
setTimeout(() => {
const localValue2 = {
name: '李四',
age: 18
}
localStorage_cTools.setLocal('IS_LOGIN', false);
localStorage_cTools.setLocal( 'USER_INFO', localValue2, true);
console.log('更新了');
}, 5000);
// `window` 相关功能测试 end =========================
</script>
</body>
</html>