williamcruzme / vue-gates

🔒 A Vue.js & Nuxt.js plugin that allows you to use roles and permissions in your components or DOM elements, also compatible as middleware and methods.

Home Page:https://williamcruzme.github.io/vue-gates/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changing Permissions removes Parent and Children from DOM in wrong order (using bootstrap)

christianhpoe opened this issue · comments

When changing the permissions in a running application (e.g. by calling a backend for updated permission) and updating them through setPermissions, many components rendering child components get removed from outward to inward. This leads to an error, where children try to remove themselve from a non existing parent.
This happens with multiple bootstrap components.
Attached you can find the errors and a code example.

Errors
image
image

Code
image

Temporary Fix:
You can fix this by using a v-show instead of the provided v-permission, which does not remove the element from the DOM but just hides it. As this can come with unwanted security implications its not an ideal fix.
image

Do you have any suggestion, how to fix this?

same happened with me as well , hopefully the maintainer can find a solution for this