[Vuejs]-How to hide the details tag without summary tag?

1👍

Use the open attribute to show the content of the <details> element by default and use v-show to conditionally display the <summary>.

<details open>
    <summary v-show="!isvisible">Hello everyone</summary>
    Content
</details>

0👍

The closest you could get is the :empty pseudoclass:

details:empty {
  display: none;
} 

Although this will only work if the summary element doesn’t exist, so would require markup changes.

👤Geat

Leave a comment