During the development process, we may encounter a scenario where the content of the tab bar is controlled according to different permissions. At this time, using the custom instruction v-permission cannot achieve the effect we want. It is to change the child of the current node. The element is removed, and the current node still exists, as shown in the figure below.
At this time, you need to use v-if to customize the control. The idea is: execute a function in v-if, and the function passes in a permission value. In the function, it is judged whether the permission value belongs to the permission menu and a Boolean value is returned.