Open
Description
When I use the Tree component in Nuxt.js, I get the 'document is not defined' error when opening the page. I guess it has to do with the SSR in Nuxt, but the error still exists with the tag.
Has somebody solved this issue?
<template>
<no-ssr>
<Tree :data="list" draggable="draggable" cross-tree="cross-tree">
<div slot-scope="{ data, store }">
<template v-if="!list.isDragPlaceHolder"
><b v-if="list.children && list.children.length" @click="store.toggleOpen(list)">
{{ list.open ? '-' : '+' }} </b
><span>{{ list.text }}</span>
</template>
</div>
</Tree>
</no-ssr>
</template>
<script>
import { Tree} from 'vue-draggable-nested-tree';
export default {
components: {
Tree,
},
computed: {
list() {
return [
{ text: '123' },
{ text: '456', children: [{ text: '456-123' }] },
{
text: '789',
children: [
{
text: '789-123',
children: [{ text: '789-123-123' }],
},
{
text: '789-456',
},
],
},
];
},
},
};
</script>```
Metadata
Metadata
Assignees
Labels
No labels