yixiaowang
yixiaowang
  • 发布:2025-09-12 17:40
  • 更新:2025-09-12 17:42
  • 阅读:23

iso 扫码报错

分类:uni-app

报错如下
17:38:22.945 [JS Framework] Failed to execute the callback function:
17:38:22.945 TypeError: this.$refs.barcode.cancel is not a function. (In 'this.$refs.barcode.cancel()', 'this.$refs.barcode.cancel' is undefined) __ERROR

我没有用组件,安卓没问题可以用,"Barcode" : {}模块也添加了 版本 4.76

2025-09-12 17:40 负责人:无 分享
已邀请:
蔡cai

蔡cai - 开发的插件:https://ask.dcloud.net.cn/article/41539

this.$refs.barcode.cancel is not a function;
你是不是有用组件,barcode

  • yixiaowang (作者)

    没有哦 是按照文档来的 没有任何第三方 也没组件

    uni.scanCode({

    success: (res) => {

    console.log("res 【@--@@--@】 ", res)

    result.value = res.result

    }

    // fail: (err) => {

    // console.log("err 【@-
    -@@--@】 ", err)

    // // 需要注意的是小程序扫码不需要申请相机权限

    // }

    })

    2025-09-12 17:53

  • 蔡cai

    回复 yixiaowang: 那就不懂咯,等有遇到的大佬或者官方看看

    2025-09-12 17:56

要回复问题请先登录注册