# yuRadio 单选tag
# 效果预览
<template>
<yu-radio
label="风险等级"
label-width="100px"
v-model="risk"
data-code="RISKLEVEL"
:disabled="false"
:details="false"
required
:rules="[{ required: true, message: '请选择风险等级' }]"
placeholder="请选择"
@change="changeSelect"
@input="changeInput"/>
<template>
<script>
import yuRadio from '@/components/yu-radio/index.vue'
export default {
components: {
yuRadio
},
data() {
return {
risk: '',
};
},
methods: {
changeSelect(val) {
console.log('==changeSelect=======>', this.selectDate1)
},
changeInput(val) {
console.log('==changeInput=======>', this.selectDate1)
}
}
}
</script>
# Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
v-model | 双向绑定值 | string(2024-04-10 00:00:02)/Date | - | - |
label | 标题 | String | - | - |
label-width | 标题宽度 | string(px) | - | - |
disabled | 是否不可编辑,暗色 | Bool | true/false | - |
details | 是否是详情反显,不可点击,正常色 | Bool | true/false | - |
placeholder | 选项框placeholder | string | - | - |
required | 选项框是否必输 | Bool | true/false | - |
rules | 选项框校验规则 | Array | - | - |
excludeKey | 数据源中排除项 | string(逗号分割) | - | - |
data-code | 数据源字典码 | string | [] | - |
options | 数据源,如果传入此参数,data-code不生效 | Array | [] | - |
# 方法
方法名 | 说明 | 参数 |
---|---|---|
changeSelect | 选择切换回调 | |
changeInput | 选择切换回调 |