Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uni-app 打包H5时,this.$root.$mp.query 这样的传参无法接收 #227

Closed
zxzhgk opened this issue Mar 1, 2019 · 2 comments
Closed
Assignees

Comments

@zxzhgk
Copy link

zxzhgk commented Mar 1, 2019

问题描述
uni-app 打包H5时,this.$root.$mp.query 这样的传参无法接收

复现步骤
[或者可以直接贴源代码]
代码:
this.$root.$mp.query
错误:
index.umd.min.js:1 [system] errorHandler TypeError: Cannot read property 'query' of undefined
at VueComponent.onLoad (main.vue:502)
at a (index.umd.min.js:1)
at s (index.umd.min.js:1)
at VueComponent.created (index.umd.min.js:1)
at callHook (vue.runtime.esm.js:2968)
at VueComponent.Vue._init (vue.runtime.esm.js:4710)
at new VueComponent (vue.runtime.esm.js:4876)
at createComponentInstanceForVnode (vue.runtime.esm.js:4376)
at init (vue.runtime.esm.js:4203)
at createComponent (vue.runtime.esm.js:5686) VueComponent {_uid: 19, _isVue: true, $options: {…}, _renderProxy: Proxy, _self: VueComponent, …} created hook
预期结果
H5版本可以正常使用this.$root.$mp.query 获取到页面的传参

系统信息:

  • 发行平台: [H5平台]
  • 操作系统 [如 iOS 12.1.2、Android 7.0]
  • HBuilderX版本 [如使用HBuilderX,版本号:1.6.2.20190220 ]
@hbcui1984 hbcui1984 assigned hbcui1984 and zhetengbiji and unassigned hbcui1984 Mar 1, 2019
@aiplat
Copy link

aiplat commented Mar 2, 2019

虽说uni-app可以打包成h5,但是我觉得目前uniapp只适合做小程序。

@xiaoyucoding
Copy link

1.7.0 已更新并修复此问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants