uni-app find()方法内不能查找变量(变量已通过this.barcode赋值)
uni-app find()方法内不能查找变量(变量已通过this.barcode赋值)
| 开发环境 | 版本号 | 项目创建方式 |
|---|---|---|
| Windows | win7 旗舰版 | HBuilderX |
产品分类:uniapp/App
PC开发环境操作系统:Windows
HBuilderX类型:正式
HBuilderX版本号:3.1.17
手机系统:Android
手机系统版本号:Android 10
手机厂商:华为
手机机型:荣耀9x
页面类型:vue
打包方式:云端
示例代码:
var barcode=this.barcode //this.barcode已通过this.barcode赋值console.log可输出值
var inde = gett.find(o =>o.fTM == barcode)
console.log(inde)
提示:
undefined
操作步骤:
var barcode=this.barcode //this.barcode已赋值console.log可输出值
var inde = gett.find(o =>o.fTM == barcode)
console.log(inde)
预期结果:
获得一个与this.barcode相关的对象
实际结果:
提示:
undefined
bug描述:
find()方法内不能查找变量(变量已通过this.barcode赋值)
var barcode=this.barcode //this.barcode已通过this.barcode赋值console.log可输出值
var inde = gett.find(o =>o.fTM == barcode)
console.log(inde)
更多关于uni-app find()方法内不能查找变量(变量已通过this.barcode赋值)的实战教程也可以访问 https://www.itying.com/category-93-b0.html
1 回复


