How to hide columns with UTable?
I'm trying with
but it doesn't work, ID is still shown. I have also tried with :state instead and it's the same. I'm using UI v3 Nuxt v4
3 Replies
Hi @i.wont.tell. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Use the column-visibility feature (v-model or prop) instead of initial-state for Nuxt UI’s UTable.
Option A — bind visibility via v-model:
(This is the documented way to control visibility state and can be toggled at runtime) (With column visibility).
Option B — set the columnVisibility state prop:
Notes:
- UTable exposes column-visibility as a first-class prop/v-model. The docs show wiring a dropdown to toggle columns and binding v-model:column-visibility to a ref object (With column visibility).
- The props section confirms columnVisibility is a supported state prop (VisibilityState) you can pass/bind directly (Props).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@450429685122334730> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
damn so I had to use ":column-visibility", but as far as I have seen there is nothing about that in the docs, what I understood is what I wrote, using an object in initial-state or state