feat(compiler-core): support shorthand syntax for v-bind - #9451
Conversation
|
RFC discussion: vuejs/rfcs#405 |
Size ReportBundles
Usages
|
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
|
/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.