同一域中的多个PWA [英] Multiple PWAs in the same domain

查看:75
本文介绍了同一域中的多个PWA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在同一端点下托管多个PWA.假设我在root下有三个不同的PWA,然后root应该托管这3个PWA,这样当我通过链接或菜单切换到任何其他应用程序时,它不应在其他窗口中打开.当前,每当我单击其他应用程序时,它将在与Web应用程序不同的窗口中打开.

Is it possible to host multiple PWAs under same endpoint. Say, I have three different PWAs Under root and then root should host these 3 PWAs in such a way that when I switch to any other apps via link or menu it shouldn't open in different window. Currently, it is getting opened in different window as web app whenever, I am clicking on different app.

谢谢, 拉胡尔

推荐答案

您可以参考

You may refer with this thread. It stated that you can accomplish this with scoped apps.

更新您的清单 文件到 包含一个scope参数,该参数的值应为"app"应具有的路径 被送达.

Update your manifest files to include a scope parameter with a value of the path that "app" should be served under.

"scope": "/r/aizumap/",

"scope": "/r/naramap/",

您仍然可以使用一个服务人员,但是每个子应用程序 路径中需要在结尾加上/ start_url/scope上班.

You can still be able to use a single service worker but each sub app will need to have a trailing / in it's path for the start_url/scope to work.

这是一个示例和一个

Here's a sample and a source which might also help.

这篇关于同一域中的多个PWA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆