Skip to content

Commit 7002045

Browse files
updated docs
1 parent 3eb41c4 commit 7002045

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const instance = getCurrentInstance()
1616
```
1717
In `<template>` add:
1818
```html
19-
<vue-dd name="setupState" v-model="instance.setupState" :deep="false" max-height="300px" />
19+
<vue-dd name="setupState" v-model="instance.setupState" />
2020
```
21-
> In the example above `:deep="false"` means, disable deep watching. Deep watching is `true` by default, but watching Vue instance or `instance.setupState` deeply can create a flood of Vue.js warnings because we start watching Vue itself. To prevent flooding, set `:deep="false"`, otherwise for simpler objects it can be simply omitted.
21+
> In the example above we are watching the whole Vue instance, it can be taxing and create Vue warnings, you can set `:deep="false"` to disable deep watching. Deep watching is `true` by default, but watching Vue instance or `instance.setupState` deeply can create a flood of Vue.js warnings because we start watching Vue itself. To prevent flooding, set `:deep="false"`, but note some live reactivity tracking will be lost. In this example it is used to show advanced capability of *vue-dd* to watch even Vue instance itself.
2222
## About
2323
The component renders object as a tree that can be expanded to display nested values, very similar to inspecting JavaScript objects using the Developer Tools, but with full reactivity & advanced UI and UX designed specifically for ease of use and joy for the developer.
2424

@@ -152,8 +152,9 @@ Versions up to **vue-dd@1.1.6** supported **Vue 2.7.5** and above, but import of
152152
// note: 'import VueDd...', and not 'import { VueDd }...'
153153
import VueDd from 'vue-dd'
154154
```
155+
Also note in Vue 2, you have to use `:model-value` instead of `v-model`
155156
```html
156-
<vue-dd v-model="obj" />
157+
<vue-dd :model-value="obj" />
157158
```
158159
> Note that Vue 2 version cannot support large objects like `window`. For some reason, it reaches a stack size limit and breaks. It is a known issue in Vue 2, that's why migrate to Vue 3 ASAP in order to use the full power of **vue-dd**
159160
## Credits & Thanks

vue-dd/README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ https://user-images.githubusercontent.com/150185/213549905-360698e2-0c6b-4fd1-80
88

99
Video example code in Vue 3 `<script setup>` style:
1010
```js
11-
import VueDd from 'vue-dd'
11+
import { VueDd } from 'vue-dd'
1212
import { getCurrentInstance } from 'vue'
1313

1414
// get Vue instance
1515
const instance = getCurrentInstance()
1616
```
1717
In `<template>` add:
1818
```html
19-
<vue-dd name="setupState" v-model="instance.setupState" :deep="false" max-height="300px" />
19+
<vue-dd name="setupState" v-model="instance.setupState" />
2020
```
21-
> In the example above `:deep="false"` means, disable deep watching. Deep watching is `true` by default, but watching Vue instance or `instance.setupState` deeply can create a flood of Vue.js warnings because we start watching Vue itself. To prevent flooding, set `:deep="false"`, otherwise for simpler objects it can be simply omitted.
21+
> In the example above we are watching the whole Vue instance, it can be taxing and create Vue warnings, you can set `:deep="false"` to disable deep watching. Deep watching is `true` by default, but watching Vue instance or `instance.setupState` deeply can create a flood of Vue.js warnings because we start watching Vue itself. To prevent flooding, set `:deep="false"`, but note some live reactivity tracking will be lost. In this example it is used to show advanced capability of vue-dd to watch even Vue instance itself.
2222
## About
2323
The component renders object as a tree that can be expanded to display nested values, very similar to inspecting JavaScript objects using the Developer Tools, but with full reactivity & advanced UI and UX designed specifically for ease of use and joy for the developer.
2424

@@ -45,15 +45,8 @@ import { VueDd } from 'vue-dd'
4545
## Usage
4646

4747
Use it just like any other Vue.js component.
48-
4948
The value to display is passed as `v-model` or `:model-value`:
5049

51-
### Usage in **Vue 3**
5250
```html
5351
<vue-dd v-model="object" />
54-
```
55-
### Usage in **Vue 2**
56-
Use `:model-value` instead of `v-model`
57-
```html
58-
<vue-dd :model-value="object" />
5952
```

0 commit comments

Comments
 (0)