vue-simple-sticky

1.0.1 • Public • Published

置顶sticky

sticky options说明

  • top : Number String, 可选,可识别['','px','rem','em']单位,无单位默认px
  • cancelSticky : Boolean, 可选,默认false,为 true 时取消Sticky组件功能。

事件

插槽

  • 默认插槽 把需要置顶的元素插入组件中

使用

<template>
<div>
	<sticky>
		<div style="width:100%;height:40px;background-color:gray"></div>
	</sticky>
	<div style="width:100%;height:100px;background-color:blue"></div>
	<sticky top='40px'>
		<div style="width:100%;height:40px;background-color:green"></div>
	</sticky>
	<div style="width:100%;height:1000px;background-color:red"></div>
</div>
</template>

<script>
import sticky from '../src/index';

export default {
	name: 'demo',
	components: {
		'sticky': sticky,
	},
};
</script>

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev 

# Packed File
npm run build

Readme

Keywords

none

Package Sidebar

Install

npm i vue-simple-sticky

Weekly Downloads

2

Version

1.0.1

License

none

Last publish

Collaborators

  • juddystar