Skip to content

Weird DOM error #84

Description

@ct1735x

I'm getting a strange red error, but only in the DOM. Vanilla console / Vue utility do not show any error.
I'm using Vue 3 with Vuex 4 and VueDraggable 4.1.0

The error : image

I'm trying to setup a drag & drop nested list, here is my code :

<template>
  <draggable v-model="categories" item-key="tid" ghost-class="ghost">
    <template #item="{ category }">
      <div>{{ category.name }}</div>
      <drag-drop v-if="category.elements.length" v-model="category.elements" />
    </template>
  </draggable>
</template>
<script>
import draggable from 'vuedraggable'

export default {
  components: {
    draggable,
  },
  computed: {
    categories: {
      get() {
        return this.$store.state.categories.all
      },
      set(value) {
        this.$store.commit('updateSortedCategories', value)
      },
    },
  },
}
</script>

If I try to write {{ categories }}, we can see that the store get is not a problem :

[ 
{ 
   "tid": "2", 
    "name": "Installation & licences", 
    "elements": [ 
     { 
        "tid": "97", 
        "name": "Sub-category", 
         "elements": [] 
      } 
      ] 
}, 
{ 
     "tid": "4", 
     "name": "Tutorial & guides", 
      "elements": [] 
}, 
{ 
     "tid": "6", 
     "name": "Videos",
      "elements": [] 
} 
]

If have no idea why this is not working as intended, am I doing something wrong ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions