Code Monkey home page Code Monkey logo

Comments (8)

HLN177 avatar HLN177 commented on August 30, 2024 3

In the codebase, the events emitted are "dragStop" and "resizeStop", and Vue provide an automatic case transformation for event names.

So try:
@drag-stop="console.log('Drag Stop')"
@resize-stop="console.log('Resize Stop')"

from vue-draggable-resizable.

HarryWuuuu avatar HarryWuuuu commented on August 30, 2024

I am curious why it worked in Vue2, Vue3 seems stricter than Vue2.

from vue-draggable-resizable.

HLN177 avatar HLN177 commented on August 30, 2024

Event in Vue2:
image

Event in Vue3:
image

It seems Vue3 provided some automatic case transformation feature to align with the nature of "props".

from vue-draggable-resizable.

kardeepak77 avatar kardeepak77 commented on August 30, 2024

Thank you @drag-stop and @resize-stop worked!

from vue-draggable-resizable.

kardeepak77 avatar kardeepak77 commented on August 30, 2024

Closing issue.
To catch drag stop and resize stop event use following -
@drag-stop="console.log('Drag Stop')"
@resize-stop="console.log('Resize Stop')"

from vue-draggable-resizable.

HarryWuuuu avatar HarryWuuuu commented on August 30, 2024

Event in Vue2: image

Event in Vue3: image

It seems Vue3 provided some automatic case transformation feature to align with the nature of "props".

Actually, I still don't understand.
As the documentation illustrated, v-on:dragStop will become v-on:dragstop in Vue2 because DOM template automatically transforms it to lowercase. So, the @dragstop shouldn't work in Vue2 as Vue-Draggable-Resizable emits dragStop event which is camel case and dragstop doesn't match dragStop. However it actually works ok in Vue2.
How to explain this one?

from vue-draggable-resizable.

HLN177 avatar HLN177 commented on August 30, 2024

Event in Vue2: image
Event in Vue3: image
It seems Vue3 provided some automatic case transformation feature to align with the nature of "props".

Actually, I still don't understand. As the documentation illustrated, v-on:dragStop will become v-on:dragstop in Vue2 because DOM template automatically transforms it to lowercase. So, the @dragstop shouldn't work in Vue2 as Vue-Draggable-Resizable emits dragStop event which is camel case and dragstop doesn't match dragStop. However it actually works ok in Vue2. How to explain this one?

You are right and I am sure you understand the Vue2 case transformation very well.

Coz I have took a look into the commit history and found these two small changed.

On 03/01/2024
image

On 16/04/2023
image

So before 16/04/2023, @dragstop worked fine all the way. : )

from vue-draggable-resizable.

HarryWuuuu avatar HarryWuuuu commented on August 30, 2024

Event in Vue2: image
Event in Vue3: image
It seems Vue3 provided some automatic case transformation feature to align with the nature of "props".

Actually, I still don't understand. As the documentation illustrated, v-on:dragStop will become v-on:dragstop in Vue2 because DOM template automatically transforms it to lowercase. So, the @dragstop shouldn't work in Vue2 as Vue-Draggable-Resizable emits dragStop event which is camel case and dragstop doesn't match dragStop. However it actually works ok in Vue2. How to explain this one?

You are right and I am sure you understand the Vue2 case transformation very well.

Coz I have took a look into the commit history and found these two small changed.

On 03/01/2024 image

On 16/04/2023 image

So before 16/04/2023, @dragstop worked fine all the way. : )

Not only in vue-draggable-resizable, in Vue2, any custom event with camel case name can be listened with camel case listener correctly. Not as that illustrated in Vue2 Doc. So wired.

from vue-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.