hookehuyr

✨ feat: 单选控件新增排列方向属性控制

<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-08-30 13:54:06
* @LastEditTime: 2022-09-08 11:37:01
* @FilePath: /data-table/src/components/RadioField/index.vue
* @Description: 文件描述
-->
......@@ -10,7 +10,7 @@
<div class="label">{{ item.label }}<span v-if="item.required">&nbsp;*</span></div>
<van-field :name="item.key">
<template #input>
<van-radio-group v-model="item.value">
<van-radio-group v-model="item.value" :direction="item.component_props.direction">
<van-radio v-for="x in item.options" :key="index" :name="x.key" icon-size="1rem"
style="margin-bottom: 0.25rem;">{{ x.value }}</van-radio>
</van-radio-group>
......
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-08 10:17:43
* @LastEditTime: 2022-09-08 11:35:17
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
......@@ -79,23 +79,24 @@ onMounted(() => {
// },
// required: false,
// },
// {
// key: 'gender',
// value: '',
// label: '性别',
// placeholder: '',
// component: '',
// component_props: {
// name: 'radio'
// },
// options: [{
// key: '男',
// value: '男'
// }, {
// key: '女',
// value: '女'
// }]
// },
{
key: 'gender',
value: '',
label: '性别',
placeholder: '',
component: '',
component_props: {
name: 'radio',
direction: 'horizontal'
},
options: [{
key: '男',
value: '男'
}, {
key: '女',
value: '女'
}]
},
// {
// key: 'hobby',
// value: [],
......@@ -172,18 +173,18 @@ onMounted(() => {
// columns_type: ['year', 'month']
// },
// },
{
key: 'time',
value: '',
label: '时间选择',
placeholder: '请选择时间',
component_props: {
name: 'time_picker',
title: '请选择',
columns_type: ['hour', 'minute']
},
required: true,
},
// {
// key: 'time',
// value: '',
// label: '时间选择',
// placeholder: '请选择时间',
// component_props: {
// name: 'time_picker',
// title: '请选择',
// columns_type: ['hour', 'minute']
// },
// required: true,
// },
// {
// key: 'image_src',
// value: '',
......