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

在h5中使用navigator组件问题 #195

Closed
weiyunpeng opened this issue Feb 12, 2019 · 9 comments
Closed

在h5中使用navigator组件问题 #195

weiyunpeng opened this issue Feb 12, 2019 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@weiyunpeng
Copy link

weiyunpeng commented Feb 12, 2019

问题描述

  1. 在h5中使用navigator组件,open-type为"navigateBack",此时将delta设置为1时会报:Expected Number with value 1, got String with value "1".

  2. 触发该组件报: should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab

预期结果

希望navigator增加对navigateBack的支持

@fxy060608
Copy link
Collaborator

可以使用 :delta="1" 来启用类型转换

@weiyunpeng
Copy link
Author

可以使用 :delta="1" 来启用类型转换


我是这样写的 不管用

@fxy060608
Copy link
Collaborator

贴一下你的代码

@weiyunpeng
Copy link
Author

<navigator
        class="action"
        open-type="navigateBack"
        :delta="1"
        hover-class="none"
        v-show="!isBar"
      >
        <text v-show="!isBar" class="icon-back"></text>
        {{name}}
      </navigator>

@weiyunpeng
Copy link
Author

另外发现使用open-type="navigateBack"编译后uni-navigator上是没有该属性的,只有参考官方提供的示例那样直接navigateBack才管用。

@xiaoyucoding xiaoyucoding self-assigned this Feb 12, 2019
@xiaoyucoding xiaoyucoding added the bug Something isn't working label Feb 12, 2019
@fxy060608
Copy link
Collaborator

fxy060608 commented Feb 12, 2019

已确认问题
1.delta 报类型错误,可以通过:delta来做类型转换
2.navigateBack,必须配置 url 的问题下个版本修复,目前可以先随便写个 url 地址

@xiaoyucoding
Copy link

1.7.0 已更新并修复此问题

@weiyunpeng
Copy link
Author

更新到最新版后,关于h5中的:delta="1",浏览器控制台依旧报:Invalid prop: type check failed for prop "delta". Expected Number with value 1, got String with value "1".

@xiaoyucoding
Copy link

更新到最新版后,关于h5中的:delta="1",浏览器控制台依旧报:Invalid prop: type check failed for prop "delta". Expected Number with value 1, got String with value "1".

<navigator :delta="1" open-type="navigateBack">back...</navigator>

HBuilderX 1.7.0.20190314
测试没有问题,如果依旧存在问题,请单独开一个 issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants