简体   繁体   English

Swift Vapor 4 Leaf 图像在运行时未显示在视图中

[英]Swift Vapor 4 Leaf Image not displayed in view on run

I am doing my first steps in vapor 4 using leaf as view renderer.我正在使用叶子作为视图渲染器在蒸汽 4 中迈出第一步。 In my data i am pasting image urls but when I run the page the browser does not show them.在我的数据中,我正在粘贴图像 url,但是当我运行页面时,浏览器不会显示它们。 The browser always shows the value of the "alt" tag.浏览器总是显示“alt”标签的值。 So I tried to build a static leaf page which only shows an image from the internet but this is also not displaying the image.所以我尝试构建一个 static 叶页,它只显示来自互联网的图像,但这也没有显示图像。 I can not figure out why.我不知道为什么。 Do I have to set somewhere that the running test Webserver should render images?我是否必须在某个地方设置正在运行的测试 Web 服务器应该呈现图像? I am using macOS Big Sur 11.0.1我正在使用 macOS Big Sur 11.0.1

Here is my leaf code (it's simple html code but does not display the image)这是我的叶子代码(它是简单的 html 代码,但不显示图像)

<!DOCTYPE html>
<html>
    <head>
        <title>Image Test</title>
    </head>
<body>
    <a href="https://www.w3schools.com/tags/img_girl.jpg">
        <img scr="https://www.w3schools.com/tags/img_girl.jpg" alt="test image" width="500" height="600">
    </a>
</body>
</html>

As Nick said it was a speeling mistake.正如尼克所说,这是一个拼写错误。

I wrote „scr“, but it must be „src“ Correct:我写了“scr”,但它必须是“src” 正确的:

<img src="https://www.w3schools.com/tags/img_girl.jpg" alt="test image" width="500" height="600">

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

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