vue自由拖拽、缩放组件

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:去除拖拽组件的边框

 

posted @ 2019-07-01 16:36  手指乐  阅读(8385)  评论(0编辑  收藏  举报