问题标签 [app-route]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
46 浏览

routes - 如果不是基本 url 聚合体,路由不起作用

我正在使用教程在聚合物 2 中使用路由,我正在设置路由,当我运行标准 url 时它工作正常......例如:testurl.com(这个工作)之后,我去的每个页面都添加路径路由没有问题。示例:testurl.com/product/123

我现在的问题是,如果我刷新此页面 (testurl.com/product/123) 不能正常工作,我的网站会加载、加载、加载和不运行......

我试图像这样配置我的应用程序路由

这就是我设置路线的方式

现在我不知道如何使构造的 url 正常工作,我不知道我做错了什么......也使用铁页,也没有问题设置页面更改,仅在具有内容的路由中基本网址。

0 投票
2 回答
125 浏览

reactjs - 升级 React 后 React Router 停止工作

我将 React 从 v16.0.0 升级到最后一个版本以使用 Hook,升级后,React Router 停止工作。

这是 AppRoute 代码:

我越来越:

输出

非常感谢!

奥里

0 投票
2 回答
56 浏览

angular - 如何在Angular中使用通配符处理未知子路由

我今天需要路由方面的帮助。我有一组组件,每个组件都有不同的路线。我想在父级和子级中为通配符路由添加“PageNotFoundComponent”。我的意思是,这是我的网址:

http://localhost:8888/programs/cohorts

cohorts是 的孩子programs。我想重定向到PageNotFoundComponent任何一个programscohorts错误的时候。这是我的代码:

应用程序路由.module.ts

我在某个地方犯了错误。请指出并帮助我。

这工作得很好:http://localhost:8888/prrrooogrm/cohorts

但这是给空白屏幕:http://localhost:8888/programs/cooohrt

我也试过这个:

0 投票
1 回答
30 浏览

angular - 角度路由添加参数

嗨,我有以下简单的 Angular 12 项目,带有登录页面和主页。代码如下:home.component.html

home.component.ts

login.component.html

登录组件.ts

然后我有一个登录框组件:

loginbox.component.html

loginbox.component.ts

应用程序路由.module.ts

当我加载主页时,它会显示以下内容

在此处输入图像描述

到目前为止一切顺利,但如果我按下登录按钮:

在此处输入图像描述

在此处输入图像描述

我不是角度方面的专家,但我知道基本知识,但我找不到有关正在发生的事情的信息。

提前致谢

0 投票
1 回答
45 浏览

python - Newbie question regarding @app.route("/index")

I was messing around with learning python myself, was working on a little HTML website using python. Anyone could please explain the differences between the two applications below?

When it's written like this it doesn't work. (this is an example I got from the top result from google)

doesn't works

but when I include the full link .html

it works?