github地址:https://github.com/kirillmurashov/vue-drag-resize
-
安装:
npm i -s vue-drag-resize -
使用:
<template>
<div>
<VueDragResize :isActive="true" :isResizable="false" >
<img src="../assets/logo.png" v-drag height="100px" width="100px" />
</VueDragResize>
</div>
</template>
<style>
.vdr.active:before{
outline: none
}
</style>
<script>
import VueDragResize from "vue-drag-resize";
export default {
components: {
VueDragResize
},
data() {
return {};
},
methods: {},
mounted() {
}
};
</script>
:isResizable="false":不支持缩放,只支持拖拽
outline: none:去除拖拽组件的边框
网友评论