question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration guide doesn't mention change for v-on event naming

See original GitHub issue

The migration guide doesn’t mention that v-on:mouseUp, v-on:mouseDown no longer works, and must be changed to v-on:mouseup, v-on:mousedown. (all lowercase)

That was a real tricky change to find out.

http://rc.vuejs.org/guide/migration.html

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisvfritzcommented, Oct 28, 2016

It looks like the problem only occurs in string templates. Knowing that, it looks like what’s happening is that since Vue 1 uses the browser’s own HTML parser, the attribute names are normalized to lowercase, since attributes are case-insensitive. This then causes the mouseUp event - which is not a valid DOM Event - to be transformed into the correct event: mouseup.

I’m glad we solved the mystery, but this isn’t something I’ll be adding to the migration guide. The fact that event names with the wrong case would sometimes work was never an intentional feature, but an unavoidable implementation quirk.

0reactions
enjikakacommented, Oct 27, 2016

@chrisvfritz https://github.com/enjikaka/vue-event-test

This is a fresh vue init webpack <folder-name> ( https://github.com/vuejs/vue-cli ) with additon of;

<h2>Event tests</h2>
<ul>
  <li><button v-on:mouseup="mouseUp">v-on:mouseup (lowercase)</button></li>
  <li><button v-on:mouseUp="mouseUp">v-on:mouseUp (camelCase)</button></li>
</ul>

and

  methods: {
    mouseUp () {
      alert('Mouse up works!');
    }
  }

in Hello.vue.

Only the lower case one works…

Testable here: https://enjikaka.github.io/vue-event-test/

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GA4] Modify and create events via the user interface
Change events and create new events based on existing events without changing site or app codeYou can create and modify events in two...
Read more >
azure-sdk-for-net/MigrationGuide.md at main - GitHub
This guide is intended to assist in the migration to Azure. ... that the client is only used to publish events and does...
Read more >
Migrate from analytics.js to gtag.js (Universal Analytics)
This guide walks you through the process of migrating an existing analytics.js Universal Analytics implementation to use gtag.js .
Read more >
Google Analytics 4: Ecommerce Guide For Google Tag Manager
Guide to implementing Google Analytics 4 Ecommerce measurement using Google Tag Manager.
Read more >
Handle configuration changes - Android Developers
If your application doesn't need to update resources during a specific configuration change and you have a performance limitation that requires ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found