0

I want it to use CSS style of margin-top = 5vh and margin-bottom = 7vh when displayConfig.minCard is true and and margin-top = 9vh and margin-bottom = 9vh when displayConfig.minCard is false

  .workflowSelectionMin{
    margin-top: 5vh;
    margin-bottom: 7vh;
  }

  .workflowSelection{
    margin-top: 9vh;
    margin-bottom: 9vh;
  }

I'm trying to use the v-bind to try to conditionally pick the css style but it seems like it's not working.

<div class="md-layout md-gutter  md-alignment-center-center" v-bind:style= "[displayConfig.minCard ? {workflowSelectionMin} : {workflowSelection}]">

1 Answer 1

1

You can just do

<div :class="[ displayConfig.mindCard ? 'workflowSelectionMin' : 'workflowSelection', 'md-layout', 'md-gutter', 'md-alignment-center-center' ]">

Take a look at the array syntax

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.