Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/corePublic

ref doesn't work properly with v-for together #1166

Closed
Labels
has workaroundA workaround has been found to avoid the problem
@Jinjiang

Description

@Jinjiang

Version

3.0.0-beta.10

Reproduction link

https://codesandbox.io/s/goofy-yalow-d0x6e?file=/src/App.vue

Steps to reproduce

<template>  <spanv-for="n in 10"ref="x">{{ n }}</span></template><script>exportdefault {mounted() {console.log(this.$refs.x);  }}</script>

What is expected?

print an array of all spans

What is actually happening?

the last span


https://vuejs.org/v2/api/#ref

When used on elements/components withv-for, the registered reference will be an Array containing DOM nodes or component instances.

Metadata

Metadata

Assignees

No one assigned

    Labels

    has workaroundA workaround has been found to avoid the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp