springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 13:32:07
99
正如标题所说,我试图让我的模板的自定义英雄部分加载,即使他们没有一个标签的文章。
的行为是间歇性的。有些标签会加载英雄,但大多数不会。
在控制台上的那些不工作,我收到一个'得到404 '错误和我的404页面加载。在那些正在工作的,我没有得到任何错误。
<div id="blog-hero">
<!-- blog hero goes here -->
</div>
<div id="article-index-background">
<div id="article-section" class="width g-flex">
<!-- paginate articles here -->
</div>
</div>
// get the hero
const pathName = window.location.pathname;
let blog_div = document.getElementById('blog-hero');
let blogName = pathName.split('/')[2];
let tagName = pathName.split('/')[4];
let request = new XMLHttpRequest();
request.open('GET', `/?section_id=blog--hero-${blogName}-blog--${tagName}`)
request.onload = () => {
if(request.readyState === request.DONE) {
if (request.status === 200) {
blog_div.innerHTML = request.responseText;
}
}
};
request.send(null);
// load the articles, paginate on screen width
let screenWidth = window.innerWidth;
let articleSection = document.getElementById('article-section');
if (screenWidth < 600) {
articleSection.innerHTML = `
{% if blog.articles %}
{% paginate blog.articles by 3 %}
{% for article in blog.articles %}
// some html
{% endfor %}
{% endpaginate %}
{% endif %}
`
} else if (screenWidth >= 600) {
articleSection.innerHTML = `
{% if blog.articles %}
{% paginate blog.articles by 6 %}
{% for article in blog.articles %}
// some html
{% endfor %}
{% endpaginate %}
{% endif %}
`
}
顺晟科技:
为了解决这个问题,我实现了一个简单的解决方法,即在博客上发表一篇标题为“隐藏的文章”的文章。并在前端隐藏任何带有该标题的博客文章。有点像黑客,但很有效。
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11