<template>
<div class="checkbox-container">
<input type="checkbox" id="custom-checkbox" class="custom-checkbox" v-model="checked" />
<label for="custom-checkbox"></label>
</div>
</template>
<script setup>
import { ref } from 'vue';
const checked = ref(false);
</script>
.checkbox-container {
position: relative;
display: inline-block;
}
.custom-checkbox {
position: absolute;
opacity: 0;
cursor: pointer;
width: 0;
height: 0;
}
.checkbox-container label {
position: relative;
display: inline-block;
width: 24px;
height: 24px;
background-color: white;
border: 2px solid #1976d2;
border-radius: 2px;
}
.checkbox-container input:checked + label {
background-color: #1976d2;
}
.checkbox-container label:after {
content: '';
position: absolute;
display: none;
left: 7px;
top: 3px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
.checkbox-container input:checked + label:after {
display: block;
}
분류 전체보기
- test 임시.. 2024.07.30
test 임시..
2024. 7. 30. 00:33