Giter VIP home page Giter VIP logo

Comments (9)

zhaoda avatar zhaoda commented on July 30, 2024

@nicklao 路由规则怎么写的?

from spa.

nicklao avatar nicklao commented on July 30, 2024

@zhaoda 路由规则这样写的 route: "home/list:num"

from spa.

zhaoda avatar zhaoda commented on July 30, 2024

路由改成 home/list/:num ,链接改成 home/list/1 这样试试呢?你说的不能正常显示,报错了么?还是显示成什么?

from spa.

nicklao avatar nicklao commented on July 30, 2024

@zhaoda 试了,还是不行!情况是没有报错,只是没有显示出任何东西,每打开一次参数不同的路由,就会产生多一个 class="spa-page spa-page-home" 的div,如果有4次传不同的参,就会有4个 class="spa-page spa-page-home" 的div。

from spa.

nicklao avatar nicklao commented on July 30, 2024

指同同一路由,即同一页面,如果有不同的传参,根据参数来作出不同的处理,SPA.JS现在是没有对这种场景处理的方法吗?

from spa.

zhaoda avatar zhaoda commented on July 30, 2024

这种情况肯定是支持的,否则路由规则就没有意义了,我怀疑你的代码逻辑有问题,你说打开 home/list1 有内容,那你在回调里拿到 num 的值 1
了么

On Wed, Aug 31, 2016 at 4:17 PM, nicklao [email protected] wrote:

指同同一路由,即同一页面,如果有不同的传参,根据参数来作出不同的处理,SPA.JS现在是没有对这种场景处理的方法吗?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#43 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAhXY6zDvPvm8L-jO9smWII1zGWHbuKlks5qlTi2gaJpZM4JxSRy
.

from spa.

nicklao avatar nicklao commented on July 30, 2024

第一次打开 home/list1 的时候回调能正常拿到num的值1,这时候会spa.js会创建一个class="spa-page spa-page-home" 的div
第二次打开 home/list2 的时候 什么都没拿到,这 时候spa.js会创建第二个class="spa-page spa-page-home" 的div

from spa.

zhaoda avatar zhaoda commented on July 30, 2024

等我在docs里写一个demo,到时候你对比试试

from spa.

nicklao avatar nicklao commented on July 30, 2024

@zhaoda 不用写了! 我看过demo,又看了一下源码。是有逻辑问题存在! 此issue可以close。

from spa.

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.