Subscribe on changes!

“Same-name Shorthand” bug?

avatar
Feb 6th 2024

Vue version

3.4.15

Link to minimal reproduction

?

Steps to reproduce

html code:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <div id="mydiv">
            <span :id></span>
            <br/>
            <span v-bind:id></span>
        </div>
        <script type="module" src="attribute_bindings_3.js"></script>
    </body>
</html>

js code:

import {createApp} from 'vue'

createApp({
    setup() {
        let id = 'myspan1';

        return {
            id
        }
    }
}).mount("#mydiv");

i will test url: https://vuejs.org/guide/essentials/template-syntax.html#same-name-shorthand

but F12 show result:

attribute_bindings_3.js:11 [Vue warn]: Template compilation error: v-bind is missing expression.
1  |  
2  |              <span :id=""></span>
   |                    ^^^^^^
3  |              <br>
4  |              <span v-bind:id=""></span> 
  at <App>

What is expected?

What is actually happening?

System Info

No response

Any additional comments?

No response