[Vuejs]-Can't implemented props using API from different js file in vue

0👍

In this method

    initialize(){
      this.items = Users;
      console.log("Cek Items : ", this.items);
    },

you set items in data, but there is no property with name items:

    return {
      search: '',
      complex: {
        headers: [
          {
            text: 'Id',
            value: 'id'
          },
          {
            text: 'Email',
            value: 'email'
          },
          {
            text: 'Action',
            value: ''
          },
        ],
        items: Users // this is inside 'complex'
      }
    };
  },

Try this:

this.complex.items = Users;

Or, if you need add new property to data, use $set:

this.$set(this.$data, 'items', Users)

Leave a comment