-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(compiler-core): support shorthand syntax for v-bind #9451
Conversation
RFC discussion: vuejs/rfcs#405 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for the rest part.
Size ReportBundles
Usages
|
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
shortBind
macro
/cc @johnsoncodehk
|
@zhiyuanzmj What's |
https://vuejs.org/api/built-in-directives.html#v-bind |
// how about
<comp @event></comp>
// equivalent to
<comp @event="event"></comp> |
Haha, how much magic is too much magic. |
Good idea, But Vue has already supported using By the way, You can also use <script setup>
import { ref } from 'vue'
const value = ref('Hello World!')
function onInput(e){
value.value=e.target.value
}
</script>
<template>
<h1>{{ value }}</h1>
<input :value :onInput />
</template>
|
Quick mention that an issue (vuejs/language-tools#3830) is already open in order to add support for that new feature. |
Just FYI, I had to learn the hard way that this does NOT work with index / key values from list renderings. |
For anyone who's interested, there's an open issue for the |
If the Edit: after reading the linked issue, it could make sense in some situations. Not a deal breaker I'd say. |
Generate an expression with the same name as propName when the expression is undefined.