You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the testData array object, I added the open property. But It open all the nodes at initially. Also, I added disableDrop property. But I can drop the nodes.
<template>
<div>Test tree
<Draggable
v-model="testData"
treeLine>
<template #default="{ node, stat }">
<button @click="stat.open = !stat.open">
{{ stat.open ? '-' : '+' }}
</button>
{{ node.text }}
</template>
</Draggable>
</div>
</template>
<script>
import {Draggable} from '@he-tree/vue';
import '@he-tree/vue/style/default.css';
export default {
name : 'TestTree',
components : { Draggable },
data () {
return {
testData : [],
selectedId : null
};
},
mounted () {
this.testData = [
{
id : 1,
text : 'Item 1',
open : true,
children : [
{ id : 2, text : 'Child 1-1', open : false, disableDrop : true },
{ id : 3, text : 'Child 1-2', open : false, disableDrop : true }
]
},
{
id : 4,
text : 'Item 2',
open : false,
children : [
{ id : 5, text : 'Child 2-1', open : false },
{ id : 6, text : 'Child 2-2', open : false }
]
}
];
}
};
</script>
Anyone please check this issue. Could you tell me what I did wrong?
The text was updated successfully, but these errors were encountered:
In the testData array object, I added the open property. But It open all the nodes at initially. Also, I added disableDrop property. But I can drop the nodes.
Anyone please check this issue. Could you tell me what I did wrong?
The text was updated successfully, but these errors were encountered: