Vue button permissions how to do ah, the Internet to find a lot but almost did not achieve, is there a more detailed article, let me have a look

how to do the vue button permission? I have found a lot on the Internet but almost failed to implement it. Is there any more detailed article? let me have a look. The back end returns the button permission like ["add","look"].
I click on this https://www.cnblogs.com/leeke.... But if I signed up for vnode.context.$route.meta.btnPermissions.split is not a function
, is there anything missing in my article?

May.19,2022

permissions are not to be given by the backend? The backend gives roles and permissions, and you determine what role the logged-in user is and what permissions he has, and then display the corresponding permissions according to these buttons. This is how I understand the


frontend display of your description. It can be divided into disable status and click the pop-up window to indicate that there is no permission. It is good to have a status in the vue data. Whether it is the front-end verification form or the user operation permission server, it is only to modify the status defined in the data accordingly.


for example, the background returns a role field to you {role: 0} 0 on behalf of the administrator
for example, if an article an ordinary user does not have the permission to delete button, it will not display
< button v-if=role > delete < / button >


you can print out $route and find your desired

step by step according to what you print out.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b41446-2c588.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b41446-2c588.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?