Element-ui radio默认选中
template代码如下:
<el-radio :label="1" @change="change" v-model="form.ifCod"
>管理员</el-radio
>
<el-radio :label="2" @change="change" v-model="form.ifCod">医生</el-radio>
<el-radio :label="3" @change="change" v-model="form.ifCod">护士</el-radio>
<el-radio :label="4" @change="change" v-model="form.ifCod">游客</el-radio>
export default {
data() {
return {
form: {
ifCode: ''
},
};
},
methods: {
单选框被选中
change(value) {
console.log('选中之后lable的值是'+value)
},
},
控制台: