laihuamin / react-music Goto Github PK
View Code? Open in Web Editor NEWvue-music用react重新做一遍
vue-music用react重新做一遍
import React, { Component } from 'react';
import {BrowserRouter as Router, Route, Link} from 'react-router-dom';
<Router>
<div>
<ul className="app-tab">
<li className="tab-item"><Link to="/">推荐</Link></li>
<li className="tab-item"><Link to="/singer">歌手</Link></li>
<li className="tab-item"><Link to="search">搜索</Link></li>
<li className="tab-item"><Link to="rank">排行</Link></li>
</ul>
<Route exact path="/" component={Recommend} />
<Route path="/singer" component={Singer} />
<Route path="/search" component={Search} />
<Route path="/rank" component={Rank} />
</div>
</Router>
import React from 'react';
import { render } from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import App from './components/app.js';
render((
<BrowserRouter>
<App />
</BrowserRouter>
),document.getElementById('root'));
<BrowserRouter>浏览器路由,使用HTML5 History API (pushState, replaceState,popState事件)来同步UI和URL
<HashRouter> (锚点路由),使用URL的哈希部分,即(window.location.hash).哈希历史记录不支持 location.key 或 location.state。 在以前的版本中,我们试图缓和行为,但是有一些边缘案例我们无法解决。 任何需要此行为的代码或插件将无法正常工作。 由于此技术仅用于支持旧版浏览器,因此我们建议您将服务器配置为使用 <BrowserHistory>。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.