hookehuyr

手机录入组件只读显示优化

<!--
* @Date: 2022-09-02 10:46:03
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-03-17 11:06:49
* @LastEditTime: 2024-06-06 16:58:14
* @FilePath: /data-table/src/components/PhoneField/index.vue
* @Description: 手机输入框
-->
......@@ -34,7 +34,7 @@
:placeholder="item.component_props.placeholder ? item.component_props.placeholder : '请输入手机号码'"
:rules="rules"
:required="item.component_props.required"
:disabled="item.component_props.readonly"
:readonly="item.component_props.readonly"
:border="false"
>
</van-field>
......@@ -73,6 +73,9 @@ const props = defineProps({
// 隐藏显示
const HideShow = computed(() => {
return !props.item.component_props.disabled
});
onMounted(() => {
props.item.value = props.item.component_props.default;
})
// web端判断
const readonly = computed(() => wxInfo().isMobile);
......