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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM