4***@qq.com
4***@qq.com
  • 发布:2020-06-30 19:43
  • 更新:2020-07-03 10:56
  • 阅读:3710

【报Bug】 [Vue warn]:Property or method "toJSON" is not defined

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 2.7.14

手机系统: Android

手机系统版本号: Android 8.0

手机厂商: 华为

手机机型: casio

页面类型: vue

打包方式: 离线

项目创建方式: HBuilderX

操作步骤:

var _self;
export default {
data() {
return {
wdWidth: 0,
wdHeight: 0,
udHeight: 0,
modalName: null,
listTouchStart: 0,
listTouchDirection: null,
username: '',
userpwd: '',
mandtCode: ''
}
},
onLoad(res) {
_self = this;
console.log(_self);
_self.wdWidth = uni.getSystemInfoSync().windowWidth;
_self.wdHeight = uni.getSystemInfoSync().windowHeight * 0.8;
uni.clearStorageSync();
}
}

预期结果:

没有报错提示

实际结果:

[Vue warn]: Property or method "toJSON" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See:

bug描述:

自定义页面全局变量时,在onload 事件中报错

2020-06-30 19:43 负责人:无 分享
已邀请:
4***@qq.com

4***@qq.com (作者)

好像是onload 打印日志时的问题

该问题目前已经被锁定, 无法添加新回复