【发布时间】:2020-02-28 17:03:36
【问题描述】:
我正在将 Ionic 3 项目转移到 Ionic 4。这是一个 Web 项目。
扫描二维码后,页面打开。网址如下:
domain.com/qanda/pwa/home?user=simon&skill=ionic&role=Admin&Table=132
直到 Ionic 3,一切都很好。如果我在 Ionic 4 中添加这些参数并运行,它会打开 domain.com/qanda/pwa/ - 一个空白页面,默认情况下甚至不会打开主页。
我在index.html 旁边保留了.htaccess 文件,这样我就可以直接从url 打开任何项目页面。下面是.htaccess的代码:
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
RewriteRule (.*) https://%{HTTP_HOST}/qanda/pwa/index.html
如何在 Ionic 4 中实现查询参数?
【问题讨论】:
-
你用什么库来传递参数?路由器链接还是导航?
标签: angular ionic-framework ionic3 ionic4