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

taro3.x使用的history库缺少history.block() 方法,无法监听路由 #10772

Closed
xianguoGou opened this issue Nov 30, 2021 · 2 comments
Closed
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@xianguoGou
Copy link

相关平台

H5

浏览器版本: Google Chrome 96.0.4664.55(正式版本)
使用框架: React

复现步骤

https://nervjs.github.io/taro/docs/h5/#%E8%B7%AF%E7%94%B1%E5%AE%88%E5%8D%AB

期望结果

能支持history.block()f方法

实际结果

没有history.block()f方法,与官方文档描述不符

环境信息

👽 Taro v3.3.1


  Taro CLI 3.3.1 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.22.2 - ~/.nvm/versions/node/v12.22.2/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 6.14.13 - ~/.nvm/versions/node/v12.22.2/bin/npm
    npmPackages:
      @tarojs/components: 3.3.1 => 3.3.1
      @tarojs/mini-runner: 3.3.1 => 3.3.1
      @tarojs/react: 3.3.1 => 3.3.1
      @tarojs/runtime: 3.3.1 => 3.3.1
      @tarojs/taro: 3.3.1 => 3.3.1
      @tarojs/webpack-runner: 3.3.1 => 3.3.1
      babel-preset-taro: 3.3.1 => 3.3.1
      eslint-config-taro: 3.3.1 => 3.3.1
      react: ^17.0.0 => 17.0.2
      taro-ui: 3.0.0-alpha.10 => 3.0.0-alpha.10
@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Nov 30, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Dec 13, 2021

@virgo569157 这样写:

import { history } from '@tarojs/router'

@Chen-jj Chen-jj closed this as completed Dec 13, 2021
@linhaobin
Copy link
Contributor

文档上没找到需要这么写

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

3 participants