<template>
<view v-for="item in dataList" :key="item['id']">
<view>{{item['username']}}</view>
<view v-for="(t,index) in item['tag']" :key="index">
<view>{{t}}</view>
</view>
</view>
</template>
export default {
data(){
return {
dataList: [id: 1, username:"test", tag: ["1","2"]
}
}
}
代码如上
报错代码行如下
<view v-for="(t,index) in item['tag']" :key="index">
报错信息如下
error: Cannot infer a type for this parameter. Please specify it explicitly.
编译错误如下
16:42:55.907 [plugin:uni:app-uts] 编译失败
16:42:55.907 error: None of the following functions can be called with the arguments supplied:
16:42:55.907 public final fun <T : UTSObject> renderList(source: TypeVariable(T)?, renderItem: (value: Any?, key: String, index: Number?) -> VNode): UTSArray<VNode> defined in io.dcloud.uniapp.vue.RenderHelpers.Companion
16:42:55.908 public final fun <T> renderList(source: UTSArray<TypeVariable(T)>?, renderItem: (value: TypeVariable(T), key: Number, index: Number?) -> VNode): UTSArray<VNode> defined in io.dcloud.uniapp.vue.RenderHelpers.Companion
16:42:55.908 public final fun renderList(source: Number?, renderItem: (value: Number, key: Number, index: Number?) -> VNode): UTSArray<VNode> defined in io.dcloud.uniapp.vue.RenderHelpers.Companion
16:42:55.908 public final fun renderList(source: String?, renderItem: (value: String, key: Number, index: Number?) -> VNode): UTSArray<VNode> defined in io.dcloud.uniapp.vue.RenderHelpers.Companion
GV000 (作者)
已解决,谢谢
2023-12-05 17:10