报错信息
index.js:515 Uncaught TypeError: Cannot read property 'data' of undefined
at initData (index.js:515)
at parseBaseComponent (index.js:1061)
at parseComponent (index.js:1128)
at parseBasePage (index.js:1146)
at parsePage (index.js:1162)
at createPage (index.js:1170)
at Object.<anonymous> (main.ts?62e8:5)
at Object.<anonymous> (main.ts?62e8:5)
at __webpack_require__ (bootstrap:78)
at checkDeferredModules (bootstrap:45)
项目构建
{
"name": "my-project1",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "npm run dev:h5",
"build": "npm run build:h5",
"build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
"build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",
"build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build",
"build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build",
"build:mp-qq": "cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build",
"build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build",
"build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",
"dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",
"dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",
"dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch",
"dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch",
"dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch",
"dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch",
"dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",
"info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js"
},
"dependencies": {
"@dcloudio/uni-app-plus": "*",
"@dcloudio/uni-h5": "*",
"@dcloudio/uni-mp-alipay": "*",
"@dcloudio/uni-mp-baidu": "*",
"@dcloudio/uni-mp-qq": "*",
"@dcloudio/uni-mp-toutiao": "*",
"@dcloudio/uni-mp-weixin": "*",
"flyio": "^0.6.2",
"regenerator-runtime": "^0.12.1",
"vue": "^2.6.10",
"vue-class-component": "^6.3.2",
"vue-property-decorator": "^8.2.1",
"vuex": "^3.0.1",
"vuex-module-decorators": "^0.9.9"
},
"devDependencies": {
"@babel/plugin-syntax-typescript": "^7.2.0",
"@dcloudio/types": "*",
"@dcloudio/uni-cli-shared": "*",
"@dcloudio/uni-template-compiler": "*",
"@dcloudio/vue-cli-plugin-hbuilderx": "latest",
"@dcloudio/vue-cli-plugin-uni": "latest",
"@dcloudio/webpack-uni-mp-loader": "*",
"@dcloudio/webpack-uni-pages-loader": "*",
"@vue/cli-plugin-babel": "3.5.1",
"@vue/cli-plugin-typescript": "^3.5.1",
"@vue/cli-service": "^3.9.0",
"babel-plugin-import": "^1.11.0",
"postcss-comment": "^2.0.0",
"typescript": "^3.0.0",
"vue-template-compiler": "^2.6.10"
},
"browserslist": [
"last 3 versions",
"Android >= 4.4",
"ios >= 8"
]
}