|
5 | 5 | - [MVVM](#mvvm) |
6 | 6 | - [Dirty Checking](#dirty-checking) |
7 | 7 | - [Data hijacking](#data-hijacking) |
8 | | - - [Proxy vs. Obeject.defineProperty](#proxy-vs-obejectdefineproperty) |
| 8 | + - [Proxy vs. Object.defineProperty](#proxy-vs-objectdefineproperty) |
9 | 9 | - [Routing principle](#routing-principle) |
10 | 10 | - [Virtual Dom](#virtual-dom) |
11 | 11 | - [Why Virtual Dom is needed](#why-virtual-dom-is-needed) |
@@ -45,7 +45,7 @@ Although dirty checking has inefficiencies, it can complete the task without car |
45 | 45 |
|
46 | 46 | ## Data hijacking |
47 | 47 |
|
48 | | -Vue internally uses `Obeject.defineProperty()` to implement two-way binding, which allows you to listen for events of `set` and `get`. |
| 48 | +Vue internally uses `Object.defineProperty()` to implement two-way binding, which allows you to listen for events of `set` and `get`. |
49 | 49 |
|
50 | 50 | ```js |
51 | 51 | var data = { name: 'yck' } |
@@ -175,9 +175,9 @@ The above implements a simple two-way binding. The core idea is to manually trig |
175 | 175 |
|
176 | 176 |
|
177 | 177 |
|
178 | | -## Proxy vs. Obeject.defineProperty |
| 178 | +## Proxy vs. Object.defineProperty |
179 | 179 |
|
180 | | -Although `Obeject.defineProperty` has been able to implement two-way binding, it is still flawed. |
| 180 | +Although `Object.defineProperty` has been able to implement two-way binding, it is still flawed. |
181 | 181 |
|
182 | 182 | * It can only implement data hijacking on properties, so it needs deep traversal of the entire object |
183 | 183 | * it can't listen to changes in data for arrays |
@@ -222,7 +222,7 @@ methodsToPatch.forEach(function (method) { |
222 | 222 | }) |
223 | 223 | ``` |
224 | 224 |
|
225 | | -On the other hand, `Proxy` doesn't have the above problem. It natively supports listening to array changes and can intercept the entire object directly, so Vue will also replace `Obeject.defineProperty` with `Proxy` in the next big version. |
| 225 | +On the other hand, `Proxy` doesn't have the above problem. It natively supports listening to array changes and can intercept the entire object directly, so Vue will also replace `Object.defineProperty` with `Proxy` in the next big version. |
226 | 226 |
|
227 | 227 | ```js |
228 | 228 | let onWatch = (obj, setBind, getLogger) => { |
|
0 commit comments