I have a table with columns v-data-table
and actions
and I want to display this column only if the user has certain permissions. I'm using a mixin to check permissions.
I tried the following without success:
{{ header.text }}
This is how I use the mixin in the component file:
import BaseLayout from "../layouts/Base/Base.vue"; import hasPermission from "../../../mixins/hasPermissions"; export default { mixins: [hasPermission], ... }
Result: [1]: https://i.stack.imgur.com/aVSgJ.png
header.actions
is a slot used to overrideactions
column header rendering. If you don't pass it (when the condition isfalse
), Vuetify will render the default representation.If you want to conditionally hide (not render) certain columns, define your table header as
computed