${props.viewWidth}rpx,
            height: ${props.viewHeight}rpx,backgroundColor: props.viewBgColor}">
<uni-icons class="icon-style" fontFamily="props.iconFamily" color="props.iconColor" size="
${props.iconSize}rpx">
        {{ props.iconCode }}</uni-icons>
<!--suppress TypeScriptValidateTypes -->
<input class="input-style" placeholder="props.iPlaceholder" type="props.iType" password="props.isPwd" confirm-type="props.iConfirmType"
style="{'background-color': props.iNBgColor, width: GetInputWidth}">
</input>  
</view>
</template>  
<script setup lang="ts">
import {ColorVariables} from "@/common/colors/Colors.ts";  
import {computed} from "@vue/runtime-core";  
interface Props {  
    viewWidth?: number;  
    viewHeight?: number;  
    viewBgColor?: string;  
    iconCode?: string;  
    iconColor?: string;  
    iconSize?: number;  
    iconFamily?: string;  
    iPlaceholder?: string;  
    iFontFamily?: string;  
    iType?: string;  
    isPwd?: boolean;  
    iConfirmType?: string;  
    iNBgColor?: string;  
}  
let props = withDefaults(defineProps<Props>(), {  
    viewWidth: 500,  
    viewHeight: 60,  
    viewBgColor: ColorVariables.bgC3,  
    iconCode: "",  
    iconColor: ColorVariables.tC1,  
    iconSize: 30,  
    iconFamily: "iconFont",  
    iPlaceholder: "",  
    iFontFamily: "customFont",  
    iType: "text",  
    isPwd: false,  
    iConfirmType: "text",  
    iNBgColor: ColorVariables.bgC5,  
});  
let GetInputWidth = computed<string>(() =>  
{  
    return props.viewWidth - (10 + props.iconSize + 8) - 20 + 'rpx';  
});  
</script>
<style scoped lang="less">
@import "@/Style.less";  
.view-style  
{  
    display: flex;  
    border: 2rpx solid @bL1;  
    border-radius: 10rpx;  
    align-items: center;  
}  
/* #ifndef MP-WEIXIN */  
.icon-style  
{  
    margin-left: 10rpx;  
}  
/* #endif */  
/* 微信小程序专用样式 */  
/* #ifdef MP-WEIXIN */  
.icon-style  
{  
    margin-left: 10rpx;  
    margin-bottom: 5rpx;  
}  
/* #endif */  
.input-style  
{  
    margin-left: 8rpx;  
    margin-top: 5rpx;  
}  
</style>
···
            
            
            
            
风起闲逸时 (作者)
有问题
2025-05-22 13:35
DCloud_UNI_JBB
回复 z***@foxmail.com: 发个可复现demo
2025-05-22 14:39
风起闲逸时 (作者)
回复 DCloud_UNI_JBB: 我重新建一个项目 按照你说调成3.4.21 小程序是可以了 但是运行到安卓模拟器又不可以了,进去直接白屏也不报错。我模拟器用的mumu4.1.25
2025-05-22 17:07
风起闲逸时 (作者)
我把项目压缩上传到附件上面了
2025-05-22 17:09