hookehuyr

测试新功能标记

1 <!-- 1 <!--
2 * @Date: 2022-08-30 11:34:19 2 * @Date: 2022-08-30 11:34:19
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-01-17 16:43:33 4 + * @LastEditTime: 2023-01-17 18:05:14
5 * @FilePath: /data-table/src/components/RadioField/index.vue 5 * @FilePath: /data-table/src/components/RadioField/index.vue
6 * @Description: 单项选择控件 6 * @Description: 单项选择控件
7 --> 7 -->
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
17 <van-field :name="item.key" :rules="item.rules"> 17 <van-field :name="item.key" :rules="item.rules">
18 <template #input> 18 <template #input>
19 <van-radio-group 19 <van-radio-group
20 + @change="onChange(item)"
20 v-model="item.value" 21 v-model="item.value"
21 :direction="item.component_props.direction" 22 :direction="item.component_props.direction"
22 style="width: 100%" 23 style="width: 100%"
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
30 style="margin-bottom: 0.25rem" 31 style="margin-bottom: 0.25rem"
31 >{{ x.title }}</van-radio 32 >{{ x.title }}</van-radio
32 > 33 >
34 + <van-field v-model="value" label="" placeholder="请输入用户名" />
33 </van-radio-group> 35 </van-radio-group>
34 </template> 36 </template>
35 </van-field> 37 </van-field>
...@@ -51,6 +53,15 @@ const themeVars = { ...@@ -51,6 +53,15 @@ const themeVars = {
51 const HideShow = computed(() => { 53 const HideShow = computed(() => {
52 return !props.item.component_props.disabled 54 return !props.item.component_props.disabled
53 }) 55 })
56 +// TEST: 测试新功能:选择其他选项时,下方出现输入框,如果其他项被选中,输入框值为最终录入值。
57 +// 绑定值发生变化时回调,处理选项为其他时的输入项录入
58 +const value = ref('');
59 +const onChange = (item) => {
60 + console.warn(item);
61 +}
62 +// onMounted(() => {
63 +// props.item.value = '120'
64 +// })
54 </script> 65 </script>
55 66
56 <style lang="less" scoped> 67 <style lang="less" scoped>
......