npm i vue-fixed-block --save-dev
<fixed-block
@changeFix="changeFix"
:fix-delay="100">
content
</fixed-block>
example app
import FixedBlock from 'vue-fixed-block'
Vue.use(FixedBlock)
Name | Type | Required | Default | Description |
---|---|---|---|---|
fix-delay | Number | false | 2 | the offset of the scroll actuation attachment |
Name | params | Type | Description |
---|---|---|---|
change-fix | fixed | Boolean | called when the block is attached or detached |
Name | params | Type | Description |
---|---|---|---|
change-fix | fixed | Boolean | called when the block is attached or detached |
example events
import {Event} from 'vue-fixed-block'
Event.$on('change-fix', function (fixed) {
// check 'fixed' param
})
Event.$emit('recalc')