1.0.3 • Published 4 years ago

sticky-anchor v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

sticky-anchor

# install
$ npm install sticky-anchor

使用说明

props: {
    // tab列表 格式[{label: 'tab1', value: '.container1'}]
    menus: {
      type: Array,
      default: () => []
    },
    // 距顶部距离
    top: {
      type: Number,
      default: 0
    },
    // tab层级
    zIndex: {
      type: Number,
      default: 101
    }
}

示例
## js
import StickyAnchor from 'sticky-anchor'
data(){
    return: {
        menus: [
            {label: 'tab1', value: '.container1', content: '21212'}
            {label: 'tab2', value: '.container2', content: '21212'}
            {label: 'tab3', value: '.container3', content: '21212'}
            {label: 'tab4', value: '.container4', content: '21212'}
        ]
    }
}

## html
<sticky-anchor :menus="menus">
    <div v-for="menu in menus" :key="menu.value" :class="menu.value">{{ item.content }}</div>
</sticky-anchor>
1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago