Home > Back-end >  Set dynamic class depending of parameter received
Set dynamic class depending of parameter received

Time:01-06

I'm new using Vuejs and I have a component that I want to set height value only if I send a parameter in props

So, my class is something like this:

 <input
            tag="section"
            
          >

As you can see I use h-full class (tailwind framework) but I want to remove it if prop comes true, so I create a new prop:

props: {
 adjustHeightToContent: {
      type: Boolean,
      default: false,
    }
  },

I want to know how can I set that CSS class to dynamic depending of parameter value

Component usage:

<BaseInput v-if="isModalShown"> </BaseInput>

CodePudding user response:

Use :

  •  Tags:  
  • Related