1

I am trying something like this:

<b-form-checkbox
  id="currently_working"
  v-model="currentlyWorking"
  value="true"
  unchecked-value="false">
    <span class="fs--1">
      I am currently working here
    </span>
</b-form-checkbox>
</b-form-group>
<p v-if="currentlyWorking">currently working</p>

However, something is going wrong here because the paragraph tag isn't toggling based on currentWorking state. Here is the codesandbox link : https://codesandbox.io/s/agitated-night-jnhxz?file=/src/components/HelloWorld.vue:43-361

1 Answer 1

2

Try this. You need to for v-if boolean true and false but your component give you a string true and false. Good luck.

 <b-form-checkbox
        id="currently_working"
        v-model="currentlyWorking"
        :value="true"
        :unchecked-value="false"
        ><span class="fs--1">
          I am currently working here
        </span></b-form-checkbox
      >
 </b-form-group>

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.