I Attempting to create a "v-checkbox" entry marked by default without using v-model directive.
In the official documentation for this Vuetify component I can't find the information on how to do this.
I tried to place this code but it doesn't work
<v-checkbox checked="true"></v-checkbox>
<v-checkbox checked="checked"></v-checkbox>
<v-checkbox checked></v-checkbox>
One way to do this is by setting input-value="true"
, as described in the API docs.
new Vue({
el: '#app',
vuetify: new Vuetify(),
})
<head>
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet">
</head>
<div id="app">
<v-app id="inspire">
<v-checkbox label="Foo" input-value="1"></v-checkbox>
</v-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.js"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With