3

Here's my code:

<v-checkbox
    :label="I agree with the Privacy Policy"
    v-model="agree2"
></v-checkbox>

and I want to have an action when I click Privacy Policy. I know I can put an url there, but I would rather show model with Vue. How can I do that?

3
  • A div that shows up via v-if="agree2"? Or a @change event on the checkbox itself? Commented Jan 30, 2019 at 14:41
  • @ceejayoz no, the checkbox is for an user to accept privacy policy. I want to show up modal if he want's to read it. Commented Jan 30, 2019 at 14:42
  • vuejs.org/v2/examples/modal.html Commented Jan 30, 2019 at 14:43

1 Answer 1

11

Use the slot with name 'label' and put into whatever any you wont:

<v-checkbox ...>
    <div slot='label'>I agree with the <myLinkComponent>...</...></div>
</v-checkbox>

You can see that from documentation: https://vuetifyjs.com/en/components/checkboxes/#label-slot

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.