我用react-router-dom我的路由和,因为我还使用GitHub的页面,我需要用HashRouter我的Router.jsx,像这样
import React from 'react';
import { HashRouter as Router, Route, Switch } from 'react-router-dom';
import Home from './Home';
import Customer from './Customer';
const MyRouter = () => (
<Router>
<Switch>
<Route path="/customer" component={Customer} />
<Route path="/" component={Home} />
</Switch>
</Router>
);
export default MyRouter;
Run Code Online (Sandbox Code Playgroud)
在我的Home.jsx组件中,我像这样定义了 propTypes
Homepage.propTypes = {
history: PropTypes.shape({ // set by react-router
push: PropTypes.func.isRequired,
}).isRequired,
};
Run Code Online (Sandbox Code Playgroud)
我的问题是,每次我#在我的 URL 中得到 a时,我想知道为什么它一直在那里,为什么我的本地主机没有#将我重定向到相同的 URL 但有#(就像我去 …
我正在尝试在 iOS 的 Safari(任何版本)上自动播放视频,并且我正在使用以下 HTML5 标签:
<video
autoPlay="true"
loop="true"
muted="true"
playsInline="true"
poster="/assets/pictures/poster.jpg"
src="https://myURL"
className="stage-vid"
/>
Run Code Online (Sandbox Code Playgroud)
由于某种原因,它可以在 Chrome 和 Firefox 上运行,但是当我检查 Chrome 上视频的.muted属性设置为true,而 Safari 中设置为false时。我正在使用 Browserstack 进行调试,但我在 iOS 设备上尝试过,即使该视频没有音轨,视频也无法播放。
多谢