uni-app 项目调试遇到的问题

uni-app 项目调试遇到的问题

  • 使用真机调试手机设置
    • 启动开发者模式
    • 启动usb调试
  • 真机调试发布完之后出现是循环,无法进入APP
    • uni-app 启动时报 Uncaught SyntaxError: Duplicate data property in object literal not allowed in strict mode at app-view.js:5132
    • 输入框重新聚焦
    • uni-app打包异常
    • uni-app 图标组件uni-icons点击事件

使用真机调试手机设置

启动开发者模式

锤子手机:设置-关于本机-连续点击5次软件版本

启动usb调试

锤子手机:设置-全局高级设置-开发者选项-USB调试

真机调试发布完之后出现是循环,无法进入APP

控制台日志如下
00:29:04.779 项目 ‘ElecReAndDe’ 开始编译…
00:29:05.947 编译器版本:3.3.11
00:29:05.947 请注意运行模式下,因日志输出、sourcemap以及未压缩源码等原因,性能和包体积,均不及发行模式。
00:29:06.120 正在编译中…
00:29:14.121 DONE Build complete. Watching for changes…
00:29:14.124 项目 ‘ElecReAndDe’ 编译成功。
00:29:14.802 正在建立手机连接…
00:29:15.851 正在安装手机端HBuilder调试基座…
00:29:37.378 Success
00:29:37.538 6384 KB/s (52866522 bytes in 8.086s)
00:29:37.951 正在同步手机端程序文件…
00:29:38.895 同步手机端程序文件完成
00:29:39.055 正在启动HBuilder调试基座
00:29:42.984 如手机上HBuilder调试基座未启动,请手动启动…
00:29:43.109 App Launch at App.vue:4
00:29:43.141 App Show at App.vue:54
00:29:43.173 App Hide at App.vue:57
00:29:43.204 at pages/index/login.vue:61
00:29:43.237 [Object] {“id”:“dt31645546827445”,“url”:“http://dc.tinci.cn:8088/pda/pda1.0.1.apk”,“downloadedSize”:13592841,"total…} at App.vue:29
00:29:43.268 App Launch at App.vue:4
00:29:43.300 App Show at App.vue:54
00:29:43.332 App Hide at App.vue:57
00:29:43.365 at pages/index/login.vue:61
00:29:43.396 [Object] {“id”:“dt31645546829801”,“url”:“http://dc.tinci.cn:8088/pda/pda1.0.1.apk”,“downloadedSize”:13592841,"total…} at App.vue:29
00:29:43.428 App Launch at App.vue:4
00:29:43.460 App Show at App.vue:54
00:29:43.492 App Hide at App.vue:57
00:29:43.524 at pages/index/login.vue:61
00:29:43.557 [Object] {“id”:“dt31645546831810”,“url”:“http://dc.tinci.cn:8088/pda/pda1.0.1.apk”,“downloadedSize”:13592841,"total…} at App.vue:29
00:29:43.587 App Launch at App.vue:4
00:29:43.619 App Show at App.vue:54
00:29:43.651 App Hide at App.vue:57
00:29:43.683 at pages/index/login.vue:61
00:29:43.715 [Object] {“id”:“dt31645546834477”,“url”:“http://dc.tinci.cn:8088/pda/pda1.0.1.apk”,“downloadedSize”:13592841,"total…} at App.vue:29
00:29:43.747 App Launch at App.vue:4
00:29:43.779 App Show at App.vue:54
00:29:43.811 App Hide at App.vue:57
00:29:43.843 at pages/index/login.vue:61
00:29:43.876 [Object] {“id”:“dt31645546837438”,“url”:“http://dc.tinci.cn:8088/pda/pda1.0.1.apk”,“downloadedSize”:13592841,"total…} at App.vue:29
00:29:43.907 App Launch at App.vue:4
00:29:43.939 App Show at App.vue:54
00:29:43.970 App Hide at App.vue:57
00:29:44.002 at pages/index/login.vue:61
00:29:44.034 [Object]

出现问题原因:
出现这个问题是因为自己写的代码有问题,程序校验是否有新版,如果有新版本自动下载安装,在判断新版本的时候放到服务器的安装包不是新版本安装包,所以会一直校验,反复安装。

uni-app 启动时报 Uncaught SyntaxError: Duplicate data property in object literal not allowed in strict mode at app-view.js:5132

启动程序后HBuilderX控制台提示Uncaught SyntaxError: Duplicate data property in object literal not allowed in strict mode at app-view.js:66368,APP界面空白
原因:标签中存在重复的属性

<input class="input" focus :focus="billFocus"  placeholder="请扫描" />

输入框重新聚焦

内容提交之后,输入框重新聚焦
直接写 this.rfidFocus=true 是不生效的,要先将rfidFocus失焦,再聚焦.

this.rfidFocus=false;
this.rfidFocus=true;

data() {
	return {
		rfidFocus:true
	}
}
<input :focus="rfidFocus" class="input" type="text"  placeholder="请扫描RFID"  />

uni-app打包异常

安心打包异常处理查询地址

https://ask.dcloud.net.cn/article/37979

uni-app 图标组件uni-icons点击事件

直接使用@click在浏览测试的时候可以正常调用,在pda上使用时只生效了一次。解决方式修改为 @click.native原生点击事件

<uni-icons custom-prefix="iconfont" type="icon-exchangerate" size="40" @click.native="changeInput">uni-icons>

你可能感兴趣的:(uni-app,vue.js,前端,javascript,uni-app)