我正在使用带有此配置的Spring Boot 2.1.0使用create-react-app和react-router制作SPA
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/**/{path:[^\\.]+}")
.setViewName("forward:/");
}
}
Run Code Online (Sandbox Code Playgroud)
基本上它的作用始终是index.html,除非路径中有一段时间.我想将其与create-react-app提供的一致.htaccess.如何使Spring Boot与此功能相匹配?
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
Run Code Online (Sandbox Code Playgroud) spring-mvc single-page-application reactjs spring-boot react-router
我有一个具有这些属性的元素
.Task-header {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-align-content: flex-start;
-ms-flex-line-pack: start;
align-content: flex-start;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
Run Code Online (Sandbox Code Playgroud)
在 Chrome 中,孩子的行为与您预期的一样,即彼此之间的空间:

在 Safari 10.1.2 中,每个孩子都占据整个宽度,因此他们出现在彼此下方

我需要做些什么来修复 Safari 之一?
编辑:这是 JSX:
<details>
<summary className="Task-header">
<h3 className="Task-header-title">{data.Name + " [" + version + "]"}</h3>
<span className={"mdi mdi-18px " + (data.Status.State === "running" ? "mdi-checkbox-marked-circle" : "mdi-close-circle")}/>
</summary>
<h3>{data.Name + " …Run Code Online (Sandbox Code Playgroud)