-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmvvm.htm
240 lines (202 loc) · 6.09 KB
/
mvvm.htm
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!--
Powered By nodePPT - This is probably the best web presentation tool so far!
version: 1.4.2
site: https://github.com/ksky521/nodePPT
date:
-->
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Reactive Programming - By 邓海龙</title>
<link rel="stylesheet" media="all" href="./css/nodeppt.css">
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="./css/phone.css">
<link rel="stylesheet" href="./js/highlight/styles/monokai_sublime.css">
<link rel="stylesheet" href="./css/font-awesome.css">
<link rel="stylesheet" href="./css/theme.moon.css">
</head>
<body>
<div class="slides">
<slides id="container">
<slide class="slide fill" style="background-image:url('./img/bg1.png')"><section class="slide-wrapper"><article class="flexbox vcenter">
<h1>Reactive Programming</h1>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><hgroup>
<h2>Agenda</h2>
</hgroup><article>
<ul class="rollIn">
<li>Reactive</li>
<li>Directive</li>
<li>Template</li>
<li>Component</li>
</ul>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><hgroup>
<h2>Excluded</h2>
</hgroup><article>
<ul class="bounceIn">
<li>语法</li>
<li>使用</li>
<li>框架对比</li>
</ul>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><hgroup>
<h2>Reactive</h2>
</hgroup><article>
<ul>
<li>Dirty Check</li>
<li>Setter</li>
<li><code>Object.defineProperty</code></li>
</ul>
</article></section></slide>
<slide class="slide fill" style="background-image:url('./img/bg1.png')"><section class="slide-wrapper"><article>
<h2>监听property赋值,diff触发回调</h2>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><article>
<h2>Object.defineProperty</h2>
<pre><code class="javascript">Object.defineProperty(obj, key, {
configurable: false,
writable: true,
set: function(value) {
// obj[key] = xxx;
// notify update
},
get: function() {
// obj[key]
// record dependency
}
});
</code></pre>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><hgroup>
<h2>Issue</h2>
</hgroup><article>
<ul>
<li>添加依赖</li>
<li><code>Array.prototype.push</code> etc.</li>
</ul>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><hgroup>
<h2>Directive</h2>
</hgroup><article>
<ul>
<li>Compiler</li>
<li>Compute Expression</li>
</ul>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><article>
<h2>Compiler custom property (<strong><code>directive</code></strong>) and element (<strong><code>component</code></strong>)</h2>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><hgroup>
<h2>Compute Expression</h2>
</hgroup><article>
<ul>
<li>Scope</li>
<li>Filter && Bind</li>
</ul>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><hgroup>
<h2>Dom Operation</h2>
</hgroup><article>
<ul>
<li>v-for</li>
<li>v-if/else</li>
</ul>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><hgroup>
<h2>Component</h2>
</hgroup><article>
<ul>
<li>Props Down</li>
<li>Events Up</li>
</ul>
</article></section></slide>
<slide class="slide"><section class="slide-wrapper"><article>
<h2>Dom Diff</h2>
<pre><code class="html"><div id="container">
<p class="message">hello world</p>
<h1 class="title">title</h1>
</div>
</code></pre>
<pre><code class="javascript">new VNode({
tagName: 'div',
attributes: {id: 'container'},
children: [
new VNode({
tagName: 'p',
attributes: {class: 'message'},
children: ['hello world']
}),
new Vnode({
tagName: 'h1',
attributes: {class: 'title'},
children: ['title']
})
]
});
</code></pre>
</article></section></slide>
<!-- <slide class="slide logoslide dark nobackground">
<article class="flexbox vcenter">
<h2 style="color: white;">Powered By nodePPT v1.4.2</h2>
</article>
</slide> -->
<div class="slideTip" id="tip"></div>
</slides>
</div>
<canvas id="drawBoard" class="draw-board" width="900" height="700"></canvas>
<div class="progress"><span id="progress"></span></div>
<div id="_buttons">
<div class="_btn-box" id="_btn-box" style="display:none;">
<button class="fa fa-arrow-circle-left" id="_btn-prev"></button>
<button class="fa fa-arrow-circle-right" id="_btn-next"></button>
<button class="fa fa-paint-brush" id="_btn-brush"></button>
<button class="fa fa-compress" id="_btn-overview" data-toggle="fa fa-expand"></button>
</div>
<button class="fa fa-bars" id="_btn-bar" data-toggle="fa fa-close"></button>
</div>
<script src="./js/mixjs/lib/mix.0.3.0.min.js"></script>
<script>
var base = location.protocol + '//' + location.host;
var path = (location.pathname + '#').split('/').filter(function(v){
return !!v;
});
path.pop();
path = path.join('/');
MixJS.config({
baseURL: [ base, path, 'js'].join('/')+'/'
});
</script>
<script src="./js/mixjs/lib/event/broadcast.js"></script>
<script src="./js/nodeppt.js"></script>
<script>
Slide.init({
containerID: 'container',
drawBoardID: 'drawBoard',
slideClass: '.slide',
buildClass: '.build',
progressID: 'progress',
transition: 'slide3',
width: 1100,
dir: './',
//打开下面的注释就开启postMessage方式
//访问网址127.0.0.1:8080/ppt/demo#client
control:{
type: 'postMessage',
args:{
isControl: false
}
},
tipID: 'tip'
});
MixJS.loadJS('highlight/highlight.pack.js',function(){
hljs.tabReplace = ' ';
hljs.initHighlightingOnLoad();
});
</script>
<script src="./js/demo.js"></script>
<link rel="stylesheet" href="./css/demo.css">
<script src="./js/zoom.js"></script>
<!--placeholder-->
</body>
</html>