Skip to content

Commit 948b1df

Browse files
committed
Added an API note regarding extracting the source plain data object via JSON parse/stringify.
1 parent 71bd59f commit 948b1df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,12 @@ type: api
353353

354354
The data object for the Vue instance. Vue.js will recursively convert its properties into getter/setters to make it "reactive". **The object must be plain**: native objects, existing getter/setters and prototype properties are ignored. It is not recommended to observe complex objects.
355355

356-
Once the instance is created, the original data object can be accessed as `vm.$data`. The Vue instance also proxies all the properties found on the data object.
356+
Once the instance is created, the data object can be accessed as `vm.$data`. The Vue instance also proxies all the properties found on the data object.
357357

358358
Properties that start with `_` or `$` will **not** be proxied on the Vue instance because they may conflict with Vue's internal properties and API methods. You will have to access them as `vm.$data._property`.
359359

360+
If required, the original **plain** data object can be extracted by passing `vm.$data` through `JSON.parse(JSON.stringify(...))`.
361+
360362
- **Example:**
361363

362364
``` js

0 commit comments

Comments
 (0)