Logical control of presence of a tab in quarto document

Trying to control which tabs are available in a quarto document. The following shows what I am attempting but does not work as tabs are not actually created.

---
title: "Tab Test"
format: html
editor: visual
---

```{r}
#| echo: false
#| include: false

# Tab control

Tab1 <- TRUE
Tab2 <- FALSE
Tab3 <- TRUE

Start the tabs

{.tabset .tabset-pills}

#| echo: false
#| include: true
#| eval: !expr Tab1
#| results: asis

# Print the tab

cat('### Tab1\n\n')
cat('Content for Tab1.\n\n')

#| echo: false
#| include: true
#| eval: !expr Tab2
#| results: asis

# Print the tab
cat('### Tab2 \n')
cat('Content for Tab2.\n\n')
#| echo: false 
#| include: true
#| eval: !expr Tab3
#| results: asis
 
# Print the tab 
cat('### Tab3\n\n')
cat('Content for Tab3.\n\n')
cat('\n')

This is the output. Hard to see without the html, but I get headers but they are not active tabs.

Tab Test
Start the tabs

Tab1
Content for Tab1.

Tab3
Content for Tab3.

Hi. Sorry for the delay.

Did you solve your problem ?

Can you edit your post to correctly format the .qmd source part ?

Also for tabs with computation content, you can probably write the ### header output of the chunk,