This commit is contained in:
2025-03-28 09:37:10 +08:00
parent 505af229fc
commit 168895b5ac
15 changed files with 347 additions and 6 deletions

36
src/components/XRadio.vue Normal file
View File

@@ -0,0 +1,36 @@
<script setup>
import {inject} from "vue";
const modelValue = inject('modelValue');
const {value} = defineProps({
value: {
type: [String, Number],
default: 0
}
});
</script>
<template>
<view @click="modelValue=value" :class="['x-radio', modelValue===value ? 'x-radio-cur' : '']">
<slot></slot>
</view>
</template>
<style lang="scss" scoped>
.x-radio {
padding: 12rpx 0;
text-align: center;
background-color: #F7F8FA;
border-radius: 4rpx;
color: rgb(78, 89, 105);
font-size: 24rpx;
font-weight: 500;
line-height: 20px;
letter-spacing: 0;
transition: 500ms;
}
.x-radio-cur {
background-color: #E8F3FF;
color: #165DFF;
}
</style>