-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdemo_async.html
84 lines (70 loc) · 2.15 KB
/
demo_async.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title> 异步加载 demo </title>
<meta name="author" content=""/>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
<link type="text/css" href="css/css.css" rel="stylesheet"/>
</head>
<body>
<div class="container" id="main" data-module="module.main" data-mode="async" data-url="module/main/main.html">
<div class="loading">订单详情正在加载中...</div>
</div>
<script src="sea.js" charset="utf-8"></script>
<script>
seajs.config({
alias:{
'$':'jq.js',
'stage':'Stage',
/** 模块基类 */
'mi.net.ModuleBase':'module/ModuleBase',
/*主模块*/
'module.main':'module/main/main',
'module.order':'module/order/order',
'module.detail':'module/detail/detail',
'module.amount':'module/amount/amount',
'cellula':'cellula-0.3.2',
'message':'message'
},
debug:true,
charset:'utf-8'
});
seajs.use(['stage', '$'], function (stage, $) {
$(document).ready(function () {
stage.init(document.body);
});
});
seajs.use('cellula', function (c) {
var a = c._util.aspect;
var cc = {
ccc:function () {
console.log('im ccc in cc');
return 'a end';
},
ddd:function(d){
console.log('im ddd in cc');
return d + ' end';
}
};
a(cc).before('ccc', function (a) {
console.log('im before!' + a);
}, this, '98793');
a(cc).after('ccc', function (a) {
console.log('im after!' + a);
}, this, '09987');
a(cc).wrap('ddd',function(){
console.log('before ddd i will init sth for it');
var ret = this._origin.apply(this,arguments);
console.log('after ddd im logging sth for it');
return ret;
});
//console.log(a);
console.log(cc);
console.log(cc.ccc());
console.log(cc.ddd('ha~ha'));
});
</script>
</body>
</html>