0👍
This one works great
<script setup>
import { ref } from 'vue'
const add_info = ref([])
</script>
<template>
<div>
<p>array of checked labels {{ add_info }}</p>
<input type="checkbox" id="checkbox" v-model="add_info" value="coolLabel" />
<label for="coolLabel">This is a cool label!</label>
</div>
</template>
As shown here
PS: you can also of course have coolLabel
as another ref
if you want to have it reusable.
- [Vuejs]-Laravel 9 Vue js 3 Pagination
- [Vuejs]-Vue TypeScript – Top level await throw withAsyncContext error
Source:stackexchange.com