我是新来的,我想知道如何通过点击链接/按钮来更改页面,我已经尝试过这个 npm 包:react-router-dom
问题是当我点击链接时,url 条目中的路径发生了变化,但页面保持不变,这是登陆页面代码:
import React, { Component } from "react";
import "jquery/dist/jquery.min.js";
import "bootstrap/dist/js/bootstrap.min.js";
import global from "../resource/global.json";
import { BrowserRouter as Router, Link } from "react-router-dom";
<div className="row" style={{ margin: "auto" }}>
<div className="row float-left" style={{ margin: "auto" }}>
<Router>
<Link
to={""}
style={{
marginRight: "15px",
border: "none",
color: global.GUI.GRIGIOSCURO,
backgroundColor: "transparent",
textAlign: "center",
textDecoration: "none",
display: "inline-block"
}}
>
Home
</Link>
<Link
to={"/terms"}
style={{
marginRight: "15px",
border: "none",
color: global.GUI.GRIGIOSCURO,
backgroundColor: "transparent",
textAlign: "center",
textDecoration: "none",
display: "inline-block"
}}
>
Termini e Condizioni
</Link>
<Link
to={"/terms"}
style={{
backgroundColor: "transparent",
marginRight: "15px",
border: "none",
color: global.GUI.GRIGIOSCURO,
textAlign: "center",
textDecoration: "none",
display: "inline-block"
}}
>
Privacy
</Link>
</Router>
</div>
我只想从登陆到点击链接按钮的条款,有什么建议吗?难道我做错了什么?谢谢
繁花如伊
相关分类