Giter Site home page Giter Site logo

Comments (8)

lblblong avatar lblblong commented on June 6, 2024

支持在 vue3 中使用的,我添加了一个 vue3 中使用的示例,你可以参考下
https://github.com/lblblong/tarojs-router-next/tree/master/examples/vue3

from tarojs-router-next.

YHoney7 avatar YHoney7 commented on June 6, 2024

我能加您个微信吗, 不知道是不是我的使用方式有问题 依旧还是没有起效果

from tarojs-router-next.

lblblong avatar lblblong commented on June 6, 2024

你这个报错可能是因为 react 和 React DOM 版本不匹配,你更新 react-dom 的版本到最新的试试

from tarojs-router-next.

YHoney7 avatar YHoney7 commented on June 6, 2024

这是父页面, 此时我需要跳转至子页面并传入一个'content'的值
1
此时子页面获取数据

from tarojs-router-next.

YHoney7 avatar YHoney7 commented on June 6, 2024

这是父页面 此时跳转至子页面并传入一个'content'的值, 跳转是可以进行跳转的
1
然后再在子页面获取数据
2
最后打印的结果为undefined
3

from tarojs-router-next.

lblblong avatar lblblong commented on June 6, 2024

这是父页面 此时跳转至子页面并传入一个'content'的值, 跳转是可以进行跳转的
1
然后再在子页面获取数据
2
最后打印的结果为undefined
3

你传过去的是 params,Router.getData 是获取不到的,参考以下获取方法

import { getCurrentInstance } from '@tarojs/taro'

onLoad () {
    const params = getCurrentInstance().router?.params,
}

如果在onLoad生命周期像这样也拿不到参数,可以换到 onShow 生命周期去拿参数试试看

from tarojs-router-next.

YHoney7 avatar YHoney7 commented on June 6, 2024

谢啦大兄弟, 通过你这种方式可以获取到, 而且你最新更新的useRouterVue不错

from tarojs-router-next.

lblblong avatar lblblong commented on June 6, 2024

嗯,通过 useRouterVue 拿参数会更好些

from tarojs-router-next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.