Fixes: 1) Replace `ElNotification` calls with `useNotification` utility across all authentication and user-related composables; 2) Add missing semicolons in multiple index exports and styled components; 3) Resolve issues with reactivity in `useStore` composable by renaming and restructuring product variables; Extra: 1) Refactor localized strings and translations for better readability and maintenance; 2) Tweak styles including scoped styles, z-index adjustments, and SCSS mixins; 3) Remove unused components and imports to streamline storefront layout.
92 lines
No EOL
1.7 KiB
Vue
92 lines
No EOL
1.7 KiB
Vue
<template>
|
|
<label class="checkbox" :class="{ isAccent }">
|
|
<input
|
|
:id="id"
|
|
class="checkbox__input"
|
|
type="checkbox"
|
|
:checked="modelValue"
|
|
@change="onChange"
|
|
/>
|
|
<span class="checkbox__block"></span>
|
|
<span class="checkbox__label">
|
|
<slot/>
|
|
</span>
|
|
</label>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const props = defineProps<{
|
|
id?: string,
|
|
modelValue: boolean,
|
|
isAccent?: boolean
|
|
}>();
|
|
const emit = defineEmits<{
|
|
(e: 'update:modelValue', v: boolean): void
|
|
}>();
|
|
|
|
function onChange(e: Event) {
|
|
const checked = (e.target as HTMLInputElement).checked;
|
|
emit('update:modelValue', checked);
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.checkbox {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
cursor: pointer;
|
|
|
|
&.isAccent {
|
|
& .checkbox__block {
|
|
border: 2px solid $accentDark;
|
|
border-radius: $default_border_radius;
|
|
}
|
|
|
|
& .checkbox__label {
|
|
color: $accentDark;
|
|
font-weight: 600;
|
|
}
|
|
}
|
|
|
|
&__input {
|
|
display: none;
|
|
opacity: 0;
|
|
}
|
|
|
|
&__block {
|
|
cursor: pointer;
|
|
display: inline-block;
|
|
width: 20px;
|
|
height: 20px;
|
|
border: 2px solid $black;
|
|
border-radius: $default_border_radius;
|
|
position: relative;
|
|
|
|
&::after {
|
|
content: "";
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
width: 10px;
|
|
height: 10px;
|
|
background-color: $accent;
|
|
border-radius: 2px;
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
&__label {
|
|
cursor: pointer;
|
|
color: #2B2B2B;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
line-height: 16px;
|
|
}
|
|
}
|
|
|
|
.checkbox__input:checked + .checkbox__block::after {
|
|
opacity: 1;
|
|
}
|
|
</style> |