Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

label with url in Vue.js

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?

like image 756
zbyshekh Avatar asked Jan 27 '26 15:01

zbyshekh


1 Answers

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

like image 122
Vsevolod Avatar answered Jan 30 '26 06:01

Vsevolod



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!