设置用户偏好.
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user