qt的JS与VUE交互错误

https://autowarefoundation.gitlab.io/autoware.auto/AutowareAuto/installation-ade.html

// qt错误   在qwebchannel.js前加 export
 Uncaught SyntaxError: Unexpected token 'export' //未捕获到的SyntaxError:意外的令牌'export'//
js: Uncaught ReferenceError: QWebChannel is not defined //js:未捕获ReferenceError:未定义QWebChannel

// 进入公司网址错误
js: Uncaught TypeError: Cannot set property 'transport' of undefined  // js:未捕获的TypeError:无法设置未定义的属性“ transport”
// 自定义的vue文件
js: Uncaught ReferenceError: VueRouter is not defined    // js:未捕获ReferenceError:未定义VueRouter

在这里插入图片描述
将 msgutils.js 内的函数开头添加 export,会出现 context错误,同时显示js:**********
删除context ,则 context错误消失,但qt显示

js: Uncaught ReferenceError: QWebChannel is not defined

将qtweb和msg拷贝到服务器,同时 在msg里添加

export  var qtWebChannel = null // 导出qtWebChannel,供其他页面调用

出现

js: TypeError: Cannot read property 'onMsg' of undefined

删除服务器里面的两个JS文件,还是一样的错误

5BCECF7A

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值