设置用户偏好.

This commit is contained in:
lijiahangmax
2023-09-26 01:11:57 +08:00
parent 99d6d16a04
commit b46541ad36
12 changed files with 243 additions and 205 deletions

View File

@@ -1,22 +1,34 @@
<template>
<!-- 数字框 -->
<a-input-number v-if="type === 'number'"
:style="{ width: '80px' }"
size="small"
:default-value="defaultValue as number"
@change="handleChange"
hide-button
/>
<a-switch v-else
hide-button />
<!-- 开关 -->
<a-switch v-else-if="type === 'switch'"
type="round"
:default-checked="defaultValue"
size="small"
@change="handleChange" />
<!-- 单选按钮 -->
<a-radio-group v-else-if="type === 'radio-group'"
type="button"
size="mini"
:default-value="defaultValue"
:options="options"
@change="handleChange" />
</template>
<script lang="ts" setup>
import { PropType } from 'vue';
import { RadioOption } from '@arco-design/web-vue/es/radio/interface';
const props = defineProps({
type: {
type: String,
default: '',
default: 'switch',
},
name: {
type: String,
@@ -26,6 +38,10 @@
type: [String, Boolean, Number],
default: '',
},
options: {
type: Array as PropType<Array<RadioOption>>,
default: []
}
});
const emit = defineEmits(['inputChange']);
const handleChange = (value: unknown) => {