<template>
<view class="tabbar">
<view class="page">
4444
</view>
<view class="tabbar-bar">
<view class="item" v-for="(item,index) in list" :key="index">
<view class="icon">{{title}}</view>
<view class="text"><text>{{item.age}}</text></view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: "hello uni-app x",
list:[{age:18},{age:11}]
}
},
onLoad() {},
methods: {
}
}
</script>
<style scoped>
.tabbar {
width: 750rpx;
flex: 1;
}
.page {
width: 750rpx;
flex: 1;
background-color: purple;
}
.tabbar-bar {
width: 750rpx;
height: 100px;
background-color: green;
}
</style>
报错信息如下
14:39:08.001 [plugin:uni:app-uts] 编译失败
14:39:08.005 error: Unresolved reference: age
14:39:08.005 at pages/tabbar/tabbar.uvue:9:36
14:39:08.005 7 | <view class="item" v-for="(item,index) in list" :key="index">
14:39:08.005 8 | <view class="icon">{{title}}</view>
14:39:08.005 9 | <view class="text"><text>{{item.age}}</text></view>
14:39:08.005 | ^
14:39:08.005 10 | </view>
14:39:08.005 11 | </view>
3***@qq.com (作者)
感谢
2023-10-27 16:54