Comments (7)
修复代码见
from sugar-blog.
Get 之前也发现了 没注意😂 我也以为vitepress bug嘞 我明后天看看 可能是我hack了什么东西导致的
from sugar-blog.
👍
大佬知道大概在哪里解决的话我可以帮忙解决一下
from sugar-blog.
👍 大佬知道大概在哪里解决的话我可以帮忙解决一下
没问题,我周末看一下,周中确实太忙了,顾不上
from sugar-blog.
看了一下 VitePress 源码 大概是下面这段代码 @rennzhang
const scrollY = window.scrollY;
const innerHeight = window.innerHeight;
const offsetHeight = document.body.offsetHeight;
const isBottom = Math.abs(scrollY + innerHeight - offsetHeight) < 1
// page bottom - highlight last one
if (anchors.length && isBottom) {
activateLink(anchors[anchors.length - 1].hash)
return
}
在我这个主题上 isBottom 判断出现了问题,具体是哪块影响的我再进一步看一下
from sugar-blog.
这个是 vitepress 正常初识的值(我这个设备)
scrollY 0
innerHeight 1067
offsetHeight 3129
abs 2062
主题上异常的值
scrollY 0
innerHeight 1067
offsetHeight 1067
abs 0
大概就是window.innerHeight
和document.body.offsetHeight
一样了导致的这个问题(在我这个主题上),应该是我这边的样式影响了 body 的 offsetHeight 高度
from sugar-blog.
这个bug在主题里是 vitepress-plugin-pagefind 这个插件引入的 我先迭代一下我这边
你可以尝试在 vitepress 侧优化一下那个 isBottom 的判断,兼容这个case
html,
body{
height: 100%;
}
from sugar-blog.
Related Issues (20)
- _pagefind/pagefind.js 404 HOT 3
- 标题栏如何配置? HOT 1
- 最低需要vitepress哪个版本呢 HOT 1
- 打包会出现问题 HOT 3
- 大佬的博客为啥没有用自己做的本地搜索插件。 HOT 2
- mac打包失败 HOT 4
- 如何被搜索引擎收录网址 HOT 2
- Feature:集成sitemap HOT 3
- 帮忙看着这个报错,这个路径下没有node.js文件 HOT 2
- rss插件里面,可以加一个鼠标移上去的title属性说明 HOT 2
- 升级主题后,无法运行 HOT 4
- 更新主题后,分页样式颜色被覆盖导致显示错误 HOT 5
- rss plugin: frontmatter.publish 更多解释? HOT 4
- 标签bug HOT 2
- 文章frontMatter使用本地cover,部署后在index页面图片路径错误 HOT 2
- [idea]右侧导航栏能否实现固定,不随着文章列表的滚动而随之滚动 HOT 4
- index.md问题 HOT 7
- Mermaid流程图打包问题 HOT 1
- [feat] vitepress-plugin-pagefind 可否增加类似 minisearch 的搜索预览 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sugar-blog.