小编car*_*aro的帖子

托管在 Firebase 上的 Ionic 4 应用仅在重新加载时返回 404

我使用@angular/pwa、firebase 托管和这个非常有用的教程创建了一个 Ionic 4 PWA

按照教程中的所有说明(并将我的应用程序构建到“www”文件夹中)之后,我使用 CLI 中的“firebase deploy”将我的工作 Ionic 4 应用程序部署到这个工作链接

问题是:在第一次访问页面时,一切都完美无缺。但是当我重新加载页面或使用搜索栏访问页面(例如,输入“ https://..link../login ”)时,Firebase 会返回 404 错误。

该文件不存在,当前目录下没有index.html,根目录下也没有404.html。

在控制台中:

加载资源失败:服务器响应状态为 404()

我的 firebase.json:

{
  "hosting": {
    "public": "www",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "headers": [
      {
        "source": "/build/app/**",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "public, max-age=31536000"
          }
        ]
      },
      {
        "source": "sw.js",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "no-cache"
          }
        ]
      }
    ]
  }
}
Run Code Online (Sandbox Code Playgroud)

我的 Angular 路由模块:(app-routing-module.ts)

firebase ionic-framework firebase-hosting angular ionic4

6
推荐指数
1
解决办法
2812
查看次数

How to change ion-button size in Ionic 4?

I'm having trouble changing the size of my ion-button in Ionic 4. This same code used to work in the previous version, Ionic 3. I've modified my width and height of the button, but nothing works.

All that shows is the standard ion-button with an unchanged height/width.

page.scss

.button {
        display: table;
        margin: 0 auto;
        border-radius: 4px;
        margin-top: 27px;
   .login {
        font-family: $font;
        letter-spacing: 2px;
        width: 280px;
        height: 50px;
        display: block;
        border-radius: 4px;
    }
}
Run Code Online (Sandbox Code Playgroud)

page.html

<div class="button"><ion-button class="login" (click)="login(oldUser)">LOGIN</ion-button></div>
Run Code Online (Sandbox Code Playgroud)

html css ionic-framework angular ionic4

0
推荐指数
1
解决办法
4401
查看次数