docs(tree): fix tree demo

This commit is contained in:
xiezongchen 2021-07-08 15:48:01 +08:00
parent 9618615ad2
commit 7c3fff1bfb
10 changed files with 20 additions and 20 deletions

View File

@ -12,7 +12,7 @@ Fortunately, the tree is now alive and it's not balanced.
```
```js
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
function createData (level = 4, baseKey = '') {
if (!level) return undefined
@ -37,7 +37,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
defaultExpandedKeys: ['40', '41']
defaultExpandedKeys: ref(['40', '41'])
}
}
})

View File

@ -13,7 +13,7 @@ Set `cascade` to use cascade check.
```
```js
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
function createData (level = 4, baseKey = '') {
if (!level) return undefined
@ -38,7 +38,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
defaultExpandedKeys: ['40', '41']
defaultExpandedKeys: ref(['40', '41'])
}
}
})

View File

@ -10,7 +10,7 @@ Tree accept `pattern` and `filter` to do searching.
```
```js
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
function createData (level = 4, baseKey = '') {
if (!level) return undefined
@ -35,7 +35,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
pattern: ''
pattern: ref('')
}
}
})

View File

@ -9,7 +9,7 @@ Set `multiple` to select multiple nodes.
```
```js
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
function createData (level = 4, baseKey = '') {
if (!level) return undefined
@ -34,7 +34,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
value: []
value: ref([])
}
}
})

View File

@ -12,7 +12,7 @@ Add some actions.
```
```js
import { h, defineComponent } from 'vue'
import { h, defineComponent, ref } from 'vue'
import { NButton } from 'naive-ui'
function createData (level = 4, baseKey = '') {
@ -47,7 +47,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
defaultExpandedKeys: ['40', '41']
defaultExpandedKeys: ref(['40', '41'])
}
}
})

View File

@ -12,7 +12,7 @@
```
```js
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
function createData (level = 4, baseKey = '') {
if (!level) return undefined
@ -37,7 +37,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
defaultExpandedKeys: ['40', '41']
defaultExpandedKeys: ref(['40', '41'])
}
}
})

View File

@ -13,7 +13,7 @@
```
```js
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
function createData (level = 4, baseKey = '') {
if (!level) return undefined
@ -38,7 +38,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
defaultExpandedKeys: ['40', '41']
defaultExpandedKeys: ref(['40', '41'])
}
}
})

View File

@ -10,7 +10,7 @@
```
```js
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
function createData (level = 4, baseKey = '') {
if (!level) return undefined
@ -34,7 +34,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
pattern: ''
pattern: ref('')
}
}
})

View File

@ -9,7 +9,7 @@
```
```js
import { defineComponent } from 'vue'
import { defineComponent, ref } from 'vue'
function createData (level = 4, baseKey = '') {
if (!level) return undefined
@ -34,7 +34,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
value: []
value: ref([])
}
}
})

View File

@ -12,7 +12,7 @@
```
```js
import { h, defineComponent } from 'vue'
import { h, defineComponent, ref } from 'vue'
import { NButton } from 'naive-ui'
function createData (level = 4, baseKey = '') {
@ -47,7 +47,7 @@ export default defineComponent({
setup () {
return {
data: createData(),
defaultExpandedKeys: ['40', '41']
defaultExpandedKeys: ref(['40', '41'])
}
}
})