20:56:42.455 error: Cannot infer a type for this parameter. Please specify it explicitly.
20:56:42.455 at uni_modules/lime-tabs/components/l-tabs/l-tabs.uvue:253:29

- 发布:2025-06-08 21:00
- 更新:2025-06-08 21:58
- 阅读:48
#插件讨论# 【 lime-tabs 选项卡 - 陌上华年 】LTabPanelComponentPublicInstance 这是什么组件,在ux中获取不到,编译不能通过

d***@qq.com (作者)
问题原因我找到了
在安卓环境下 l-tabs.uvue
145行
const children = ref<LTabPanelComponentPublicInstance[]>([])
换成
const children = ref<TabPanel[]>([])
就行
然后在255行有个条件编译
// 安卓端数组属性存在BUG 死循环
// #ifdef APP-ANDROID
const offset = item.innderOffset
// #endif
// #ifndef APP-ANDROID
const offset = item.offset ?? []
// #endif
因为多加了个 item.innderOffset
还要在type.ts中的offset ?: any[];下面加上
// #ifdef APP-ANDROID
innderOffset ?: any[];
// #endif
就解决了问题
另外全局搜了下,还有好几处有引用了LTabPanelComponentPublicInstance这东东,这个是个不存在的type,暂时没有用到这些组件也没报错,待后面用到后再看是否要全部换成TabPanel
-
LTabPanelComponentPublicInstance是tab的子组件,是自动生成的。可能你没有使用到l-tab-panel导致这个类型没有生效。我测一下不使用这个子组件是不是会存在这个问题。感谢
2025-06-08 23:55
-
d***@qq.com (作者)
回复 陌上华年:
<l-tabs v-model="tabIndex" :list="tabList" @click="tabClick" :syncSwiper="true" />
data() {
return {
kw: '',
title: 'Hello',
tabList: [] as UTSJSONObject[],
tabIndex: 0,
swiperIndex: 0,
// styles: new Map<string, any>(),
swiperItemStyles: {
height: '400px',
} as UTSJSONObject,
}
},
onLoad() {
let tabs = [
{
value: 1,
label: '选项1',
},
{
value: 2,
label: '选项2',
},
{
value: 3,
label: '选项3',
},
{
value: 4,
label: '选项4',
}
]
this.tabList.push(...tabs)
},
我是这样写的
2025-06-09 23:50
陌上华年
https://ext.dcloud.net.cn/publisher/start-session?pluginId=20630 这个链接进入
2025-06-08 21:28