首页 > 解决方案 > 生产模式下的角度奇怪行为

问题描述

当我在生产模式下构建我的项目时ng build --prod --output-path=../Angular --base-href=/autopoint/ --deploy-url=/autopoint/Angular/,在标签出现之前的 html 顶部有一条奇怪的线,但是当我使用 ng serve 运行它时,它就消失了。任何想法这可能是由什么引起的?

_Layout.cshtml

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AutoPoint</title>
    <base href="/" />
    <link href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,600,800&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    @Styles.Render("~/Angular/Styles")
</head>
<body id="app">

@RenderBody()


    @Scripts.RenderFormat("<script src='{0}' type='module'></script>", "~/Angular/Scripts")
    @Scripts.RenderFormat("<script src='{0}' nomodule defer></script>", "~/Angular/ScriptsIE")
</body>
</html>

索引.cshtml

<app-root></app-root>

在此处输入图像描述

在此处输入图像描述

标签: angularangular8document-body

解决方案


问题解决了。不可见的空白字符。 在此处输入图像描述


推荐阅读