1.0.1 • Published 4 years ago
vue-draggable-patch v1.0.1
vue-draggable-patch
VueDraggablePatch适用于vue.js 2.x
版本。解决移动端可拖动挂角贴片touch拖拽、自动吸附的交互。
安装
npm install vue-draggable-patch -S
使用
patch
组件接收自定义的slot作为贴片内容渲染,默认距离底部定位100px
,可通过传入buttom
props覆盖默认值。
<template>
<div class="main">
<patch :bottom="100" class="demo">
<img src="https://via.placeholder.com/50" alt="">
</patch>
</div>
</template>
<script>
import Vue from 'vue';
import VueDraggablePatch from 'vue-draggable-patch';
Vue.use(VueDraggablePatch);
/**
* or
* Vue.component(Patch.name, Patch);
*/
export default {};
</script>
<style>
.demo img {
display: block;
}
</style>
语法规范
VueDraggablePatch通过umd
兼容模式打包,支持amd
、commonsjs
、commonsjs2
、window
全局变量等方式引入。