Giter Site home page Giter Site logo

Comments (1)

a7650 avatar a7650 commented on May 22, 2024

如何添加模块标识id,触发事件时,返回模块id。
如: :moduleId="id001"
触发拖拽,缩放时返回moduleld的值,和返回payload一样。

目前插件里没有带这个功能,你可以这样写:

<template>
  <div id="app">
    <div class="parent">
      <Vue3DraggableResizable @drag-end="handle($event, 'id', 'drag-end')">
        This is a test example
      </Vue3DraggableResizable>
    </div>
  </div>
</template>

<script>
import { defineComponent } from 'vue'
import Vue3DraggableResizable from './components/Vue3DraggableResizable'

export default defineComponent({
  components: { Vue3DraggableResizable },
  data() {
    return {}
  },
  mounted() {},
  methods: {
    dragEndHandle(e, id) {
      console.log(e, id)
    },
    handle(e, id, type) {
      if (type === 'drag-end') {
        this.dragEndHandle(e, id)
      }
    }
  }
})
</script>

from vue3-draggable-resizable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.