Skip to content

Allow to v-bind the template ref #1681

@ByScripts

Description

@ByScripts

What problem does this feature solve?

When using setup(), it would seems more natural to bind the ref property to the template ref attribute.

Bonus: Allows Ctrl/Cmd Click "Go to declaration" in IDE's :)

What does the proposed API look like?

<template>
  <h1 :ref="titleEl">Here is my title</h1>
</template>

<script>
export default {
  setup() {
    const titleEl = ref();
    return { titleEl };
  }
}
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions