在紫杉的自动更新年份
我正在尝试更新紫杉(Rust)的版权年。这是我尝试的以下代码,但不幸的是它不起作用。
use yew::prelude::*;
use chrono::prelude::*;
#[function_component(Footer)]
pub fn footer() -> Html
{
let current_date = chrono::Utc::now().date();
html!
{
<>
<div class={ "static bottom-0 bg-[#fff] opacity-90 container mx-auto max-w-3xl py-8" }>
<footer>
<div class={ "flex justify-center space-x-4" }>
<h1>{ format!("Copyright {} Name. All Rights Reserved.", current_date.year()) }</h1>
</div>
</footer>
</div>
</>
}
}
我想知道如何在不遇到错误的情况下进行这项工作。
我正在使用中继线服务,其中没有显示任何错误,但是当我使用此特定代码时,它不会加载页面。
I am trying to update the copyright year in yew wasm (rust). This is the below code I am trying but it does not work unfortunately.
use yew::prelude::*;
use chrono::prelude::*;
#[function_component(Footer)]
pub fn footer() -> Html
{
let current_date = chrono::Utc::now().date();
html!
{
<>
<div class={ "static bottom-0 bg-[#fff] opacity-90 container mx-auto max-w-3xl py-8" }>
<footer>
<div class={ "flex justify-center space-x-4" }>
<h1>{ format!("Copyright {} Name. All Rights Reserved.", current_date.year()) }</h1>
</div>
</footer>
</div>
</>
}
}
I was wondering how do I make this work without getting errors.
I am using trunk serve where in it does not show any errors but the page it self does not load when I use this specific code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的帖子显示完整程序吗?如果没有,您可以发布吗?
同时,尝试替换以下行:
使用此行:
Is your post showing the full program? If not, Can you post it?
In meantime, try to replace the below line:
with this line: