-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.drawio
349 lines (349 loc) · 54.9 KB
/
vue.drawio
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<mxfile host="app.diagrams.net" modified="2023-07-22T03:54:17.328Z" agent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" etag="KiR2okI0ytIRDtyXPCxw" version="21.6.2" type="github" pages="2">
<diagram name="Page-1" id="DigjpKDBXrDzWGz_JIb7">
<mxGraphModel dx="1050" dy="550" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="2339" pageHeight="3300" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="QlYBTfubAc0jVH9a7X75-1" value="<b><font style="font-size: 18px;">initState</font></b>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="324" y="126" width="99" height="38" as="geometry" />
</mxCell>
<mxCell id="QlYBTfubAc0jVH9a7X75-2" value="<span style="font-size: 18px;"><b>initProps</b></span>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="324" y="214" width="99" height="38" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="TsjlxxYHDJNQvXe3dho_" name="响应式">
<mxGraphModel dx="1050" dy="550" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="0" fold="1" page="1" pageScale="1" pageWidth="2339" pageHeight="3300" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="bhZDkHVfK8WzJ8-mESIo-2" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; line-height: 19px;"><font style="font-size: 18px;">initMixin</font></div>" style="rounded=1;whiteSpace=wrap;html=1;strokeColor=default;fontColor=default;labelBackgroundColor=none;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="1445" y="84" width="103" height="37" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-5" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-3" target="bhZDkHVfK8WzJ8-mESIo-4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-10" value="<b>options对象判断</b>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="bhZDkHVfK8WzJ8-mESIo-5">
<mxGeometry x="-0.0769" relative="1" as="geometry">
<mxPoint x="125" y="-23" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-28" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-3" target="bhZDkHVfK8WzJ8-mESIo-9">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1497" y="265" />
<mxPoint x="1060" y="265" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-3" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; line-height: 19px;"><div style="line-height: 19px;"><font style="font-size: 18px;">initState</font></div></div>" style="rounded=1;whiteSpace=wrap;html=1;strokeColor=default;fontColor=default;labelBackgroundColor=none;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="1445" y="169" width="103" height="37" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-7" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-4" target="bhZDkHVfK8WzJ8-mESIo-6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-11" value="Y" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="bhZDkHVfK8WzJ8-mESIo-7">
<mxGeometry x="-0.1972" y="-2" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-4" value="props" style="rhombus;whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="616" y="322" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-99" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-6" target="bhZDkHVfK8WzJ8-mESIo-98">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-6" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;">defineReactive</div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="585.63" y="438" width="140.75" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-8" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><b>initMethods</b></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=0;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1142" y="451.5" width="92.25" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-14" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-9" target="bhZDkHVfK8WzJ8-mESIo-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-15" value="Y" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="bhZDkHVfK8WzJ8-mESIo-14">
<mxGeometry x="-0.4725" y="2" relative="1" as="geometry">
<mxPoint y="1" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-9" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><b>methods</b></div>" style="rhombus;whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=0;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1142" y="345" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-16" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="1089.5" y="332.5" width="27" height="26" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-22" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-17" target="bhZDkHVfK8WzJ8-mESIo-20">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-23" value="Y" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="bhZDkHVfK8WzJ8-mESIo-22">
<mxGeometry x="-0.1055" y="2" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-25" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-17" target="bhZDkHVfK8WzJ8-mESIo-24">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1671.5" y="358" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-26" value="N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="bhZDkHVfK8WzJ8-mESIo-25">
<mxGeometry x="-0.26" y="2" relative="1" as="geometry">
<mxPoint y="1" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-17" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><b>data</b></div>" style="rhombus;whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=0;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1456.5" y="317.5" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-42" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-20" target="bhZDkHVfK8WzJ8-mESIo-39">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-20" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">initData</div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1457.75" y="441" width="77.5" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-24" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;">observe(<span style="">vm</span>.<span style="">_data</span> = {}, <span style="">true</span>)</div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1576" y="338" width="253" height="39" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-27" value="<b>如果没有传,则赋值为空对象,设置为响应式</b>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="1576" y="310" width="258" height="26" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-29" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-3" target="bhZDkHVfK8WzJ8-mESIo-17">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1446" y="220" as="sourcePoint" />
<mxPoint x="1656" y="511" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-37" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-31" target="bhZDkHVfK8WzJ8-mESIo-32">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-31" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;">computed</div></div>" style="rhombus;whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1885" y="320" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-32" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">initComputed</div></div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1870.25" y="438" width="109.5" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-38" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-33" target="bhZDkHVfK8WzJ8-mESIo-34">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-33" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">watch</div></div></div>" style="rhombus;whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="2024" y="322" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-34" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">initWatch</div></div></div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="2025.25" y="438" width="77.5" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-35" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-3" target="bhZDkHVfK8WzJ8-mESIo-31">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1639" y="535" as="sourcePoint" />
<mxPoint x="1689" y="485" as="targetPoint" />
<Array as="points">
<mxPoint x="1497" y="264" />
<mxPoint x="1925" y="266" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-36" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-3" target="bhZDkHVfK8WzJ8-mESIo-33">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1717" y="543" as="sourcePoint" />
<mxPoint x="1767" y="493" as="targetPoint" />
<Array as="points">
<mxPoint x="1497" y="264" />
<mxPoint x="2065" y="266" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-46" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.387;exitY=0.955;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-92" target="bhZDkHVfK8WzJ8-mESIo-47">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1460" y="644" as="sourcePoint" />
<mxPoint x="1496.6" y="687" as="targetPoint" />
<Array as="points">
<mxPoint x="1493" y="655" />
<mxPoint x="1493" y="667" />
<mxPoint x="1497" y="667" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-93" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-39" target="bhZDkHVfK8WzJ8-mESIo-92">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-39" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">这里需要注意两点,</div><div style="line-height: 19px;">1. 跟Vue的data可以是函数也可以是对象,子组件的data必须是函数,因为是箭头函数的时:data: vm =&gt; ({ a: vm.myProp }) 其次避免同一个引用造成的影响。https://blog.csdn.net/shaleilei/article/details/78084171</div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;align=left;verticalAlign=top;horizontal=1;" vertex="1" parent="1">
<mxGeometry x="1274.5" y="493" width="444" height="119" as="geometry" />
</mxCell>
<UserObject label="https://github.com/ustbhuangyi/vue-analysis/issues/25" id="bhZDkHVfK8WzJ8-mESIo-40">
<mxCell style="text;whiteSpace=wrap;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="1865.9999755859376" y="673.0000122070312" width="315" height="36" as="geometry" />
</mxCell>
</UserObject>
<UserObject label="相同属性的优先级
props ==> methods ==> data ==> computed ==> watch
" link="https://blog.csdn.net/qq_45937484/article/details/124616832" id="bhZDkHVfK8WzJ8-mESIo-44">
<mxCell style="text;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="1567" y="210" width="377.4" height="36" as="geometry" />
</mxCell>
</UserObject>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-51" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-47" target="bhZDkHVfK8WzJ8-mESIo-50">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-58" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-47">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1496.6" y="833" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-59" value="N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="bhZDkHVfK8WzJ8-mESIo-58">
<mxGeometry x="-0.3349" y="1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-47" value="<b style="">查看value是否有__ob__属性</b>" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="1442.5" y="683" width="108" height="108" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-50" value="<b style="">查看value是否有__ob__属性,表明为响应式对象</b>" style="rhombus;whiteSpace=wrap;html=1;strokeColor=none;align=left;" vertex="1" parent="1">
<mxGeometry x="1583" y="685.5" width="129.5" height="103" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-54" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">赋值到ob</div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1333" y="720.25" width="77.5" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-55" value="" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-47" target="bhZDkHVfK8WzJ8-mESIo-54">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1190" y="892" as="sourcePoint" />
<mxPoint x="1240" y="842" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-57" value="Y" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="bhZDkHVfK8WzJ8-mESIo-55">
<mxGeometry x="-0.2688" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-62" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-60" target="bhZDkHVfK8WzJ8-mESIo-61">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-60" value="<span style="">1. 是否要执行shouldObserve<br>2. 不是为服务端渲染<br>3. 是否为对象或数组<br>4. !value<span style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px;">.</span><span style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px;">_isVue<br><br>是否满足以上条件<br></span></span>" style="rhombus;whiteSpace=wrap;html=1;align=left;labelBackgroundColor=none;fontColor=default;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="1409" y="830" width="183.5" height="173" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-64" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-61" target="bhZDkHVfK8WzJ8-mESIo-63">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-66" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-61" target="bhZDkHVfK8WzJ8-mESIo-65">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-61" value="new&nbsp;Observer(value)" style="rounded=1;whiteSpace=wrap;html=1;align=left;labelBackgroundColor=none;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="1440.75" y="1047.5" width="120" height="37" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-63" value="创建响应式对象" style="rounded=1;whiteSpace=wrap;html=1;align=left;labelBackgroundColor=none;fontStyle=1;fontColor=default;strokeColor=none;" vertex="1" parent="1">
<mxGeometry x="1598.5" y="1036" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-65" value="valueb绑定__ob__属性,职位当前Observe的实例" style="rounded=1;whiteSpace=wrap;html=1;align=left;labelBackgroundColor=none;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="1436.13" y="1129" width="129.25" height="60" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-76" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-70" target="bhZDkHVfK8WzJ8-mESIo-78">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1664" y="1340" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-70" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">对象</div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1624" y="1255" width="77.5" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-74" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-65" target="bhZDkHVfK8WzJ8-mESIo-70">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1213" y="1502" as="sourcePoint" />
<mxPoint x="1263" y="1452" as="targetPoint" />
<Array as="points">
<mxPoint x="1503" y="1211" />
<mxPoint x="1664" y="1211" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-81" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-75" target="bhZDkHVfK8WzJ8-mESIo-80">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-75" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">通过Object<span style="">.</span><span style="">defineProperty对每一个key数据劫持</span></div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;strokeColor=default;align=left;" vertex="1" parent="1">
<mxGeometry x="1565.38" y="1411" width="197" height="52" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-79" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-78" target="bhZDkHVfK8WzJ8-mESIo-75">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-78" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">const <span style="">dep</span> = <span style="">new</span> <span style="">Dep</span>()</div></div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1572.13" y="1328" width="183.5" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-91" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-80" target="bhZDkHVfK8WzJ8-mESIo-90">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-80" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="">get: function reactiveGetter () {</div><div style="">&nbsp; &nbsp; &nbsp; <span style="">const</span> <span style="">value</span> = <span style="">getter</span> ? <span style="">getter</span>.<span style="">call</span>(<span style="">obj</span>) : <span style="">val</span></div><div style="">&nbsp; &nbsp; &nbsp; <span style="">debugger</span></div><div style="">&nbsp; &nbsp; &nbsp; <span style="">// 依赖收集</span></div><div style="">&nbsp; &nbsp; &nbsp; <span style="">if</span> (<span style="">Dep</span>.<span style="">target</span>) {</div><div style="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="">dep</span>.<span style="">depend</span>()</div><div style="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="">if</span> (<span style="">childOb</span>) {</div><div style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="">childOb</span>.<span style="">dep</span>.<span style="">depend</span>() <span style="">// ?</span></div><div style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="">if</span> (<span style="">Array</span>.<span style="">isArray</span>(<span style="">value</span>)) {</div><div style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="">dependArray</span>(<span style="">value</span>)</div><div style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="">&nbsp; &nbsp; &nbsp; }</div><div style="">&nbsp; &nbsp; &nbsp; <span style="">return</span> <span style="">value</span></div><div style="">&nbsp; &nbsp; }</div></div>" style="whiteSpace=wrap;html=1;align=left;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1432.94" y="1495" width="461.88" height="354" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-86" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-82" target="bhZDkHVfK8WzJ8-mESIo-85">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<UserObject label="https://github.com/vuejs/vue/issues/8562" link="https://github.com/vuejs/vue/issues/8562" id="bhZDkHVfK8WzJ8-mESIo-83">
<mxCell style="text;whiteSpace=wrap;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="1361.0041750919117" y="1873.998177849265" width="244" height="36" as="geometry" />
</mxCell>
</UserObject>
<UserObject label="记一次思否问答的问题思考:Vue为什么不能检测数组变动 https://segmentfault.com/a/1190000015783546?_ea=4074035


有以下两个原因:

1. 对性能消耗大 
2. this.text[2] = 'abc' 无法监听
" id="bhZDkHVfK8WzJ8-mESIo-84">
<mxCell style="text;whiteSpace=wrap;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="1080" y="1358" width="423" height="36" as="geometry" />
</mxCell>
</UserObject>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-87" value="<div style="color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Consolas, &quot;Courier New&quot;, monospace; font-weight: normal; font-size: 14px; line-height: 19px;"><div><span style="color: #6a9955;">/*</span></div><div><span style="color: #6a9955;">&nbsp;* not type checking this file because flow doesn't play well with</span></div><div><span style="color: #6a9955;">&nbsp;* dynamically accessing methods on Array prototype</span></div><div><span style="color: #6a9955;">&nbsp;*/</span></div><br><div><span style="color: #c586c0;">import</span><span style="color: #d4d4d4;"> { </span><span style="color: #9cdcfe;">def</span><span style="color: #d4d4d4;"> } </span><span style="color: #c586c0;">from</span><span style="color: #d4d4d4;"> </span><span style="color: #ce9178;">'../util/index'</span></div><br><div><span style="color: #569cd6;">const</span><span style="color: #d4d4d4;"> </span><span style="color: #4fc1ff;">arrayProto</span><span style="color: #d4d4d4;"> = </span><span style="color: #4ec9b0;">Array</span><span style="color: #d4d4d4;">.</span><span style="color: #4fc1ff;">prototype</span></div><div><span style="color: #c586c0;">export</span><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">const</span><span style="color: #d4d4d4;"> </span><span style="color: #4fc1ff;">arrayMethods</span><span style="color: #d4d4d4;"> = </span><span style="color: #4ec9b0;">Object</span><span style="color: #d4d4d4;">.</span><span style="color: #dcdcaa;">create</span><span style="color: #d4d4d4;">(</span><span style="color: #4fc1ff;">arrayProto</span><span style="color: #d4d4d4;">)</span></div><br><div><span style="color: #569cd6;">const</span><span style="color: #d4d4d4;"> </span><span style="color: #4fc1ff;">methodsToPatch</span><span style="color: #d4d4d4;"> = [</span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #ce9178;">'push'</span><span style="color: #d4d4d4;">,</span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #ce9178;">'pop'</span><span style="color: #d4d4d4;">,</span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #ce9178;">'shift'</span><span style="color: #d4d4d4;">,</span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #ce9178;">'unshift'</span><span style="color: #d4d4d4;">,</span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #ce9178;">'splice'</span><span style="color: #d4d4d4;">,</span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #ce9178;">'sort'</span><span style="color: #d4d4d4;">, </span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #ce9178;">'reverse'</span></div><div><span style="color: #d4d4d4;">]</span></div><br><div><span style="color: #6a9955;">/**</span></div><div><span style="color: #6a9955;">&nbsp;* Intercept mutating methods and emit events</span></div><div><span style="color: #6a9955;">&nbsp;*/</span></div><div><span style="color: #4fc1ff;">methodsToPatch</span><span style="color: #d4d4d4;">.</span><span style="color: #dcdcaa;">forEach</span><span style="color: #d4d4d4;">(</span><span style="color: #569cd6;">function</span><span style="color: #d4d4d4;"> (</span><span style="color: #9cdcfe;">method</span><span style="color: #d4d4d4;">) {</span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #6a9955;">// cache original method</span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #569cd6;">const</span><span style="color: #d4d4d4;"> </span><span style="color: #4fc1ff;">original</span><span style="color: #d4d4d4;"> = </span><span style="color: #4fc1ff;">arrayProto</span><span style="color: #d4d4d4;">[</span><span style="color: #9cdcfe;">method</span><span style="color: #d4d4d4;">]</span></div><div><span style="color: #d4d4d4;">&nbsp; </span><span style="color: #dcdcaa;">def</span><span style="color: #d4d4d4;">(</span><span style="color: #4fc1ff;">arrayMethods</span><span style="color: #d4d4d4;">, </span><span style="color: #9cdcfe;">method</span><span style="color: #d4d4d4;">, </span><span style="color: #569cd6;">function</span><span style="color: #d4d4d4;"> </span><span style="color: #dcdcaa;">mutator</span><span style="color: #d4d4d4;"> (...</span><span style="color: #9cdcfe;">args</span><span style="color: #d4d4d4;">) {</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; </span><span style="color: #569cd6;">const</span><span style="color: #d4d4d4;"> </span><span style="color: #4fc1ff;">result</span><span style="color: #d4d4d4;"> = </span><span style="color: #4fc1ff;">original</span><span style="color: #d4d4d4;">.</span><span style="color: #dcdcaa;">apply</span><span style="color: #d4d4d4;">(</span><span style="color: #569cd6;">this</span><span style="color: #d4d4d4;">, </span><span style="color: #9cdcfe;">args</span><span style="color: #d4d4d4;">)</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; </span><span style="color: #569cd6;">const</span><span style="color: #d4d4d4;"> </span><span style="color: #4fc1ff;">ob</span><span style="color: #d4d4d4;"> = </span><span style="color: #569cd6;">this</span><span style="color: #d4d4d4;">.</span><span style="color: #9cdcfe;">__ob__</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; </span><span style="color: #569cd6;">let</span><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">inserted</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; </span><span style="color: #c586c0;">switch</span><span style="color: #d4d4d4;"> (</span><span style="color: #9cdcfe;">method</span><span style="color: #d4d4d4;">) {</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; &nbsp; </span><span style="color: #c586c0;">case</span><span style="color: #d4d4d4;"> </span><span style="color: #ce9178;">'push'</span><span style="color: #d4d4d4;">:</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; &nbsp; </span><span style="color: #c586c0;">case</span><span style="color: #d4d4d4;"> </span><span style="color: #ce9178;">'unshift'</span><span style="color: #d4d4d4;">:</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #9cdcfe;">inserted</span><span style="color: #d4d4d4;"> = </span><span style="color: #9cdcfe;">args</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #c586c0;">break</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; &nbsp; </span><span style="color: #c586c0;">case</span><span style="color: #d4d4d4;"> </span><span style="color: #ce9178;">'splice'</span><span style="color: #d4d4d4;">:</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #9cdcfe;">inserted</span><span style="color: #d4d4d4;"> = </span><span style="color: #9cdcfe;">args</span><span style="color: #d4d4d4;">.</span><span style="color: #dcdcaa;">slice</span><span style="color: #d4d4d4;">(</span><span style="color: #b5cea8;">2</span><span style="color: #d4d4d4;">)</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #c586c0;">break</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; }</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; </span><span style="color: #c586c0;">if</span><span style="color: #d4d4d4;"> (</span><span style="color: #9cdcfe;">inserted</span><span style="color: #d4d4d4;">) </span><span style="color: #4fc1ff;">ob</span><span style="color: #d4d4d4;">.</span><span style="color: #dcdcaa;">observeArray</span><span style="color: #d4d4d4;">(</span><span style="color: #9cdcfe;">inserted</span><span style="color: #d4d4d4;">)</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; </span><span style="color: #6a9955;">// notify change</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; </span><span style="color: #4fc1ff;">ob</span><span style="color: #d4d4d4;">.</span><span style="color: #9cdcfe;">dep</span><span style="color: #d4d4d4;">.</span><span style="color: #dcdcaa;">notify</span><span style="color: #d4d4d4;">()</span></div><div><span style="color: #d4d4d4;">&nbsp; &nbsp; </span><span style="color: #c586c0;">return</span><span style="color: #d4d4d4;"> </span><span style="color: #4fc1ff;">result</span></div><div><span style="color: #d4d4d4;">&nbsp; })</span></div><div><span style="color: #d4d4d4;">})</span></div><br></div>" style="text;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="305.0005882352941" y="1140.001162109375" width="550" height="896" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-85" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-weight: normal; font-size: 14px; line-height: 19px;"><div>对数组的方法进行重写,进行相应</div><div>'push',</div><div><span style="">'pop'</span>,</div><div><span style="">'shift'</span>,</div><div><span style="">'unshift'</span>,</div><div><span style="">'splice'</span>,</div><div><span style="">'sort'</span>,</div><div><span style="">'reverse'</span></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;align=left;" vertex="1" parent="1">
<mxGeometry x="886.75" y="1497" width="246" height="215.75" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-69" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">数组</div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="971" y="1310" width="77.5" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-82" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">数组</div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="971" y="1406" width="77.5" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-68" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-65" target="bhZDkHVfK8WzJ8-mESIo-69">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1501.5" y="1222" as="targetPoint" />
<Array as="points">
<mxPoint x="1501" y="1209" />
<mxPoint x="1017" y="1209" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-71" value="<b>判断vaue还是对象,进行不同的处理</b>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="bhZDkHVfK8WzJ8-mESIo-68">
<mxGeometry x="-0.4621" y="-3" relative="1" as="geometry">
<mxPoint x="17" y="7" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-88" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.006;exitY=0.425;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-85" target="bhZDkHVfK8WzJ8-mESIo-87">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="902" y="1797" as="sourcePoint" />
<mxPoint x="952" y="1747" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-90" value="最终每一个key 都会变成数据相应的,且会递归的去触发绑定。" style="whiteSpace=wrap;html=1;align=left;rounded=1;labelBackgroundColor=none;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="1602.75" y="1901" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-96" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-92" target="bhZDkHVfK8WzJ8-mESIo-95">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-92" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;"><div style="line-height: 19px;">proxy(<span style="">vm</span>, <span style="">`_data`</span>, <span style="">key</span>)</div></div></div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="1395.75" y="637" width="201.5" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-95" value="<b>对vm绑定_data</b>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1659" y="640.5" width="167" height="30" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-102" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="bhZDkHVfK8WzJ8-mESIo-98" target="bhZDkHVfK8WzJ8-mESIo-101">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-98" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;"><div style="line-height: 19px;">proxy</div></div>" style="whiteSpace=wrap;html=1;rounded=1;labelBackgroundColor=none;fontStyle=1;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="619.13" y="503" width="73.75" height="33.5" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-100" value="每一个key进行响应式挂载" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="432" y="439" width="157" height="26" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-101" value="<div style="font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; line-height: 19px;">进行数据绑定 - this.message--&gt; this._props.messgae this是vm</div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;labelBackgroundColor=none;fontColor=default;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="146" y="504.25" width="465" height="31" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-103" value="<font style=""><span style="font-size: 18px;"><b>props在什么时候触发,数据更新的?</b></span><br><br><div style=""><b style=""><font style="font-size: 12px;">数据的查找,是触发渲染wacher,然后寻找绑定的数据</font></b></div><div style=""><font size="3"><br></font></div><div style=""><b style=""><font size="3"><div style="">&nbsp; function proxy (target, sourceKey, key) {</div><div style="">&nbsp; &nbsp; // this.data&nbsp; --&gt; this._data.messgae</div><div style="">&nbsp; &nbsp; sharedPropertyDefinition.get = function proxyGetter () {</div><div style="">&nbsp; &nbsp; &nbsp; return this[sourceKey][key]</div><div style="">&nbsp; &nbsp; };&nbsp;</div><div style="">&nbsp; &nbsp; sharedPropertyDefinition.set = function proxySetter (val) {</div><div style="">&nbsp; &nbsp; &nbsp; this[sourceKey][key] = val;</div><div style="">&nbsp; &nbsp; };</div><div style="">&nbsp; &nbsp; Object.defineProperty(target, key, sharedPropertyDefinition);</div><div style="">&nbsp; }</div></font></b></div></font>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="40" y="164" width="499" height="274" as="geometry" />
</mxCell>
<mxCell id="bhZDkHVfK8WzJ8-mESIo-104" value="<font style="font-size: 14px;"><b><span style="font-family: -apple-system, system-ui, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">父组件传给子组件props后,子组件不必再重复观测<code style="font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; word-break: break-word; border-radius: 2px; overflow-x: auto; padding: 0.065em 0.4em;">props。通过</code></span>shouldObserve变量去控制。</b></font>" style="text;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontColor=default;" vertex="1" parent="1">
<mxGeometry x="169.9999755859375" y="548.0000122070312" width="444" height="42" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>