运行微信小程序报错:Bad attr data-event-opts with message

问题

使用uniapp 编译,运行微信小程序环境时,报错 Bad attr data-event-opts with message。(这个错误报错原因很多,这里只解决一个)

原因

原因是:代码中有:

复制代码
:key="'swiperList' + i"

解决方法

复制代码
<swiper-item v-for="(arr, i) in swiperList" :key="10000000 + i"></swiper-item>

不要使用字符串,使用数字就没有问题。

相关推荐
icebreaker13 小时前
Weapp-vite:原生模式之外,多一种 Vue SFC 选择
前端·vue.js·微信小程序
icebreaker13 小时前
重走 Vue 长征路 Weapp-vite:编译链路与 Wevu 运行时原理拆解
前端·vue.js·微信小程序
大米饭消灭者3 天前
Taro是怎么实现一码多端的【底层原理】
微信小程序·taro
FliPPeDround4 天前
Vitest Environment UniApp:让 uni-app E2E 测试变得前所未有的简单
微信小程序·e2e·前端工程化
FliPPeDround4 天前
微信小程序自动化的 AI 新时代:wechat-devtools-mcp 智能方案
微信小程序·ai编程·mcp
吴声子夜歌5 天前
小程序——布局示例
小程序
码云数智-大飞5 天前
如何创建自己的小程序,码云数智与有赞平台对比
微信小程序
luffy54595 天前
微信小程序页面使用类似filter函数的wxs语法
微信小程序·小程序
Slow菜鸟5 天前
微信小程序开发(二)目录结构完全指南
微信小程序·小程序
攀登的牵牛花5 天前
给女朋友写了个轻断食小程序:去老丈人家也是先动筷了
前端·微信小程序