4.0.0 • Published 4 years ago

@huteming/ui-anchor v4.0.0

Weekly downloads
4
License
ISC
Repository
-
Last release
4 years ago

锚点


引入

import { Anchor } from '@huteming/ui'

Vue.use(Anchor)
// Vue.directive(Anchor.name, Anchor)

例子

<div v-anchor="{ selector: '#target', container: '.basic' }">锚点</div>

API

参数说明类型可选值默认值
selector锚点滚动目标String
container滚动容器,最近一个 overflow 值为 auto 或 scroll 的父元素String
top距离容器顶部距离。会以屏幕宽度为750px自适应String
duration滚动动画持续时间,单位:msNumber300
done完成之后的回调函数Function(to)