简体   繁体   English

是否可以使用 spring boot mobile 为桌面和移动网站提供不同的 index.html?

[英]Is it possible to serve different index.html for desktop and mobile websites with spring boot mobile?

I have a React Single Page APP (SPA) that I want to serve both mobile and desktop users with.我有一个 React Single Page APP (SPA),我想同时为移动和桌面用户提供服务。 Trouble is that I have two different versions of my app for desktop or mobile because the home page UI differs by quite a bit between desktop or mobile.问题是我有两个不同版本的桌面或移动应用程序,因为桌面或移动设备的主页 UI 差别很大。

Using Spring Boot mobile to distinguish which device a user is visiting my app from, is it possible to serve different index.html?使用 Spring Boot mobile 来区分用户从哪个设备访问我的应用程序,是否可以提供不同的 index.html?

So say, for a mobile visitor I'd want to serve my indexMobile.html and for a desktop user I'd serve indexDesktop.html as the home page, can you do this with Spring Boot?所以说,对于移动访问者,我想为我的 indexMobile.html 提供服务,而对于桌面用户,我想为 indexDesktop.html 作为主页提供服务,你能用 Spring Boot 做到这一点吗?

So far, all the online guides I've seen eventually boil down to using either different Thymeleaf templates (which I'm not using, I'm using react app) or simply using a single index.html as the entry point into the app but I need different home page entrypoints in my app.到目前为止,我看到的所有在线指南最终都归结为使用不同的 Thymeleaf 模板(我没有使用,我使用的是 react 应用程序)或者只是使用单个 index.html 作为应用程序的入口点但我的应用程序中需要不同的主页入口点。

Help any one?帮助任何人?

I think css media query may help我认为 css媒体查询可能会有所帮助

Or you may use css framework( Bootstrap , W3.CSS ) to reduce designing time或者你可以使用 css 框架( Bootstrap , W3.CSS )来减少设计时间

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM