D
D
Doclassif02021-10-27 09:12:15
Vue.js
Doclassif0, 2021-10-27 09:12:15

Object not working?

I do not know how to describe this question correctly knowledge is not enough.

There is a 'vued3tree' component in general, such an object gets into it

tree1: {
        name: "father",
        children: [
          {
            name: "son1",
            children: [{ name: "grandson" }, { name: "grandson2" }],
          },
          {
            name: "son2",
            children: [{ name: "grandson3" }, { name: "grandson4" }],
          },
        ],
      }


And everything outputs well, but if, for example, I drop it like this
this.test = this.tree1
and naturally write :data="test" in the component's data,

then this error

[Vue warn]: Error in nextTick: "TypeError: Cannot read properties of undefined (reading 'x') "
app.js:70726 TypeError: Cannot read properties of undefined (reading 'x')

What could be the problem? I also can not get from the database and after the object converted to js.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question