admin管理员组

文章数量:1294475

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?

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?

Share asked Jan 30, 2019 at 14:39 Zbyszek KisłyZbyszek Kisły 2,2486 gold badges29 silver badges53 bronze badges 3
  • A div that shows up via v-if="agree2"? Or a @change event on the checkbox itself? – ceejayoz 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. – Zbyszek Kisły Commented Jan 30, 2019 at 14:42
  • vuejs/v2/examples/modal.html – ceejayoz Commented Jan 30, 2019 at 14:43
Add a ment  | 

1 Answer 1

Reset to default 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./en/ponents/checkboxes/#label-slot

本文标签: javascriptlabel with url in VuejsStack Overflow