<template>
<list-view style="flex:1">
<list-item v-for="(item,index) in list" :key="index">
<view class="item-wrapper">
<view>
<image class="logo" :src="item.url"></image>
</view>
<view class="text-area">
<text class="title">模板编号:{{item.id}}</text>
<text class="title">模板类型:{{item.execType}}</text>
<text class="title">输入行数:{{item.textLine}}行</text>
</view>
<view>
<button>使用案例</button>
</view>
</view>
</list-item>
</list-view>
</template>
<script lang="uts">
type Templates = {
id : number,
url : string,
execType : string,
textLine : number,
}
export default {
data() {
return {
title: 'Hello' as string,
list: [
{
id: 12121,
url: "/static/logo.png",
execType: "photoshop",
textLine: 1
},{
id: 12121,
url: "/static/logo.png",
execType: "photoshop",
textLine: 1
},
] as Templates[]
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.logo {
max-height: 100px;
width: 100px;
}
.text-area {
width: 200px;
}
.title {
margin-left: 10px;
font-size: 18px;
color: #8f8f94;
text-align: left;
}
.item-wrapper{
display: flex;
flex-direction: row;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 10px;
}
</style>

- 发布:2025-03-23 00:16
- 更新:2025-03-23 00:16
- 阅读:51
【报Bug】使用安卓手机基座调试,报Cannot infer a type for this parameter. Please specify it explicitly.
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win11
HBuilderX类型: 正式
HBuilderX版本号: 4.56
手机系统: Android
手机系统版本号: Android 12
手机厂商: 一加
手机机型: GM1910
页面类型: nvue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
但凡我改动data里面的东西,就会报错,哪怕多增加一个变量a:1
报这个
Cannot infer a type for this parameter. Please specify it explicitly.
但凡我改动data里面的东西,就会报错,哪怕多增加一个变量a:1
报这个
Cannot infer a type for this parameter. Please specify it explicitly.
预期结果:
我代码没问题就不应该报错啊,但是我看之前的帖子我也加了类型,不知道是不是我代码真的写错了
我代码没问题就不应该报错啊,但是我看之前的帖子我也加了类型,不知道是不是我代码真的写错了
实际结果:
改一下代码报错就一下,很难受
改一下代码报错就一下,很难受
bug描述:
我特地还录了屏,格式应该没问题,因为时好时坏
我只要在list中复制一个item,就会提示Cannot infer a type for this parameter. Please specify it explicitly.
然后我把【模板类型】与【输入行数】这两行text代码,注释掉,保存,就不会报错
而且我撤销注释,保存,也不会报错
0 个回复