Comments (4)
感谢您的反馈!
问题1:没有hx标签上下滚动按钮点击没有反应是BUG,我已经修复;
问题2:toolbar 的按钮是可以手动添加的,只是添加功能是在子组件 outline.toolbar 中封装的,Outline 对象还没有添加按钮的直接接口,稍后我会添加上;
目前只能通过 outline.toolbar.add() 方法添加具体用法请先查看 toolbar 的代码中的 add() 方法:
https://github.com/yaohaixiao/outline.js/blob/master/src/toolbar.js
不过目前的问题是内置的自定义图标还很少,我还需要调整一下
from outline.js.
感谢解答
from outline.js.
还有一个问题就是这个向上或向下,得手动点一下才会判断到达顶部/底部并隐藏向上或向下按钮,不知道有没有自动判断在顶部或底部的逻辑
以及离顶部/底部多高时显示向上或向下按钮
from outline.js.
添加了自定义按钮的配置 tools 和 addButton() 和 removeButton() 方法
上下按钮的控制是根据滚动距离判断的:
onToolbarUpdate({ top, min, max }) {
const toolbar = this.toolbar
const current = Math.ceil(top)
if (current <= min) {
toolbar.hide('up')
toolbar.show('down')
} else if (current >= max) {
toolbar.hide('down')
toolbar.show('up')
} else if (current > min && current < max) {
toolbar.show('up')
toolbar.show('down')
}
return this
}
const top = offsetTop($heading) - (stickyHeight + 10)
const min = 0
const max = this.$scrollElement.scrollHeight
from outline.js.
Related Issues (20)
- 点击目录无法跳转、、 HOT 1
- 作者加入一个说明吧,关于html需要调用css,我因为这个卡了好久 HOT 1
- 有个小问题,在vue中使用时,页面往回跳转(从文章页码跳转到主页)后会显示目录索引,这个可以优化吗? HOT 1
- 生成序号时,序号和标题之间没有空格 HOT 1
- vue3使用 css文件缺失 HOT 1
- 使用DOM元素初始化报错 HOT 3
- 遇到一个问题 HOT 7
- highlight 函数报错 HOT 2
- 有没有更新的方法 HOT 2
- 兄弟,这个插件如何直接就显示出目录导航,而不用点击列表再显示目录导航? HOT 6
- 能不能让大纲的滚动条也能跟着文章内容滚动 HOT 2
- 兄弟,对于不支持的低版本的浏览器,能不能直接console.log说下不支持低版本浏览器? HOT 3
- 大哥,报告个bug HOT 2
- 你好,在浏览器Chromium 60.0.3112.113版本上,点击文章目录导航却不跳转,这算是bug吗? HOT 12
- H1-H6标题中包含数字会被过滤 HOT 2
- Uncaught TypeError: this.calculateStickyHeight is not a function HOT 5
- 没有目录树的情况下只能点击抵达底部 HOT 5
- Vue2中这个报错怎么解决 HOT 2
- 需要增加自定义标题的 href 的途径,方便做语义化标题跳转 HOT 1
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 outline.js.