GithubHelp home page GithubHelp logo

Comments (2)

switer avatar switer commented on June 5, 2024

感谢反馈

  1. bridge.js里面,有代理跳转方式,里面会派发redirectType + name的消息:
redirectDelegate: function (emitter, dispatcher) {
  ;['navigateTo', 'redirectTo', 'switchTab', 'reLaunch'].forEach(function (k) {
    emitter.on(k, function (url) {
      var name = getPageName(url)
      name && dispatcher.emit(k+':'+name, url, fns.queryParse(url.split('?')[1]))
    })
  })
}
  1. component在微信组原生件化版本之前是需要传name ,升级后对应错误信息没错率,应该去掉
  2. message的wait方式也是遗漏没删除的代码
  3. 框架默认通过 App.config.route 去反射页面路径,获取页面id,这是routeResolve 。有些项目页面目录规则会稍微复杂,所以也提供了自定义的反射方法 App.config.resolvePath,这是customRouteResolve :
A({
  config: {
    route: ['/page/$page', '/pages/$page'],
    resolvePath: function (name) {
      return `/page/${name}`
    }
  }
});

from wxpage.

clevok avatar clevok commented on June 5, 2024

soga

大大,那个第一点,就是 emitter 他只发出了 navigateTo 事件应该。
redirector.js;

exportee.emit('navigateTo', cfg.url)

然后在page.js 通过 bridge.redirectDelegate(redirector, dispatcher) 转发事件

因为

dispatcher.on('navigateTo:'+name, onNavigateHandler)
	dispatcher.on('redirectTo:'+name, onNavigateHandler)
	dispatcher.on('switchTab:'+name, onNavigateHandler)
	dispatcher.on('reLaunch:'+name, onNavigateHandler)

都执行一个方法,只是没影响,因为并不需要知道他是哪种方法触发

from wxpage.

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.