I
I
iAlex1952020-07-29 19:15:54
Vue.js
iAlex195, 2020-07-29 19:15:54

How to correctly divide the user interface into user roles?

Good day.
How to make sure that when logging in, one component is displayed to a user with one role, and another component is displayed to a user with a different role.
I use vuex and vue router. On the Laravel backend.
The situation does not seem complicated, but confused. Please help.

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-07-29
@iAlex195

You can put v-if right at the root of the components and specify a value depending on the role of each component.
Well, output both, just one will cut itself out at this moment.
Or make a wrapper component that will connect the right one via https://ru.vuejs.org/v2/guide/components.html#%D0%...
Or make two routes and redirect to the right one if the role is wrong.
So many ways :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question