GithubHelp home page GithubHelp logo

Comments (9)

sorrycc avatar sorrycc commented on May 14, 2024
import { routerRedux } from 'dva/router';

然后在 effects 里:

yield put(routerRedux.push('/app'));

from dva.

helloyou2012 avatar helloyou2012 commented on May 14, 2024

其实可以像 choo 一样把 history 的接口内置:https://github.com/yoshuawuyts/choo/blob/master/index.js#L148

from dva.

sorrycc avatar sorrycc commented on May 14, 2024

@helloyou2012 看实现,choo 里内置了 location:setLocation 的 reducer,和我们通过 routerRedux 的操作并没有太大区别吧。

from dva.

helloyou2012 avatar helloyou2012 commented on May 14, 2024

恩,不过这样不用每次都 import routerRedux ,直接 put 就可以了

from dva.

sorrycc avatar sorrycc commented on May 14, 2024

被你一说还真觉得有点麻烦,1.0 之后我想想怎么简化。

from dva.

nikogu avatar nikogu commented on May 14, 2024

import { routerRedux } from 'dva/router'; 这种其实更直观,感觉对熟悉 redux 的人更友好,如果像 choo 一样内置了,感觉有点凌乱

from dva.

Manweill avatar Manweill commented on May 14, 2024

我就是觉得每次都要导进去有点麻烦。所以才这么问的,然而文字表达有问题 O__O "…

from dva.

wenzhihong2003 avatar wenzhihong2003 commented on May 14, 2024

同意 @nikogu 的说法,

import { routerRedux } from 'dva/router'; 

这样更加的直观, 太高程度的封装, 反而让人不知道来源了.

from dva.

longzb avatar longzb commented on May 14, 2024

@manwei-lww 我喜欢每次都导。反正也不麻烦。

from dva.

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.