Issue passing array to field

45 Views Asked by At

I would like to show all permissions associated to the role i am editing. issue is i dont get a value but when i console. log the issue it seems to exist

enter image description here

showEditModal(role,index) {
      role.permissions.push(role.permissions.id)
      let obj = {
               id: role.id,
               name: role.name,
               permissions: role.permissions
      };
      console.log(role.permissions)
      this.editData = obj;
      this.editModal = true;
      this.index = index;
    },

this is my code where i would to get an array of data in my edit form, any help would be highly appreciated

1

There are 1 best solutions below

1
m.kimiaee On

well i think that you are passing editData to the modal component as a prop, and when you are setting editModal to true, it has not been passed yet, try using $nextTick for setting editModal to true, it might fix your problem.

this.$nextTick().then(() => {
    this.editModal = true;
});