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.

Alias for v-on and v-bind

See original GitHub issue

What problem does this feature solve?

If you’ve decided to go with v-bind and v-on shorthands then v-on="$listeners" looks out of place and creates a mixture of syntax. Shorthands for v-on and v-bind would solve that issue.

What does the proposed API look like?

v-on="$listeners" should be aliased like this: @="$listeners"

v-bind="$attrs" should be aliased like this: :="$attrs"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
posvacommented, Dec 12, 2018

I don’t think this is a good idea, v-bind= and v-on= do not happen that often to offer a shorthand syntax that is confusing. Having the full text version makes things more readable since it’s a v-bind or v-on without argument is so different from one with an argument. So I think having both v-bind and v-on is actually a good thing because they are visible (or out of place) while := and @= are not

1reaction
CyberAPcommented, Dec 12, 2018

One great thing about @ and : aliases is that they are instantly recognizable, and I couldn’t say that about v-bind and v-on. I would say that it is one of the main reasons people prefer this syntax over the other.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"You are binding v-model directly to a v-for iteration alias ...
The message is telling you that you can't directly modify a v-for alias (which run is). Instead you can use index to refer...
Read more >
Form Input Bindings - Vue.js
When dealing with forms on the frontend, we often need to sync the state of form input elements with corresponding state in JavaScript....
Read more >
Enhance Jest configuration with Module Aliases - Alex Jover
Let's go to src/App.vue and change the reference to those two components: import MessageList from '@/components/MessageList' import ...
Read more >
jQuery.noConflict() | jQuery API Documentation
Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery's case, $ is just an alias...
Read more >
Working with Certificates and SSL (Sun Java System ...
Display certificate information from a keystore of type JKS. keytool -list -v -alias ${cert.alias} -keystore ${keystore.file} -storepass ${keystore.
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