当前位置: 首页 > 工具软件 > At.js > 使用案例 >

uniapp 真机运行报错 cid unmatched [object Object] at view.umd.min.js:1

荣曾笑
2023-12-01

H5端运行页面一切正常,真机调试报错 cid unmatched [object Object] at view.umd.min.js:1

TypeError: Cannot read property ‘name’ of undefined
14:52:04.189 cid unmatched [object Object] at view.umd.min.js:1
14:52:04.209 TypeError: Invalid attempt to destructure non-iterable instance.
14:52:04.229 In order to be iterable, non-array objects must have a Symbol.iterator method. at view.umd.min.js:1

这个错误导致我页面布局直接乱套,最后发现问题出在页面渲染的数据上,可以检查一下for循环内是否引用了未被定义的内容(以下是我的代码)

修改前:

//before----------------------------------------------------------
<template>
<view class="atitle">
		<p>{{data['sjxy'].title}}</p>
		<view class="title-texOne">
			<view @tap="toPath({url:sjxy.moreLink})">{{data['sjxy'].more}}</view>
		</view>
</view>
</template>

<script>
export default {
	data() {
		return {
			data:{}
		}
	}
}
</script>

修改后:

//after--------------------------------------------------------
<template>
<view class="atitle">
		<p>{{sjxy.title}}</p>
		<view class="title-texOne">
			<view @tap="toPath({url:sjxy.moreLink})">{{sjxy.more}}</view>
		</view>
</view>
</template>

<script>
export default {
	data() {
		return {
			data:{},
			sjxy:{}
		}
	}
}
</script>
 类似资料: