Skip to content
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

GridItem 中动态绑定 ref,打印出重复多次绑定 #780

Open
Greasen opened this issue Oct 20, 2023 · 1 comment
Open

GridItem 中动态绑定 ref,打印出重复多次绑定 #780

Greasen opened this issue Oct 20, 2023 · 1 comment

Comments

@Greasen
Copy link

Greasen commented Oct 20, 2023

Software version (please complete the following information):

  • Browser [e.g. chrome, safari]
  • Vue Version [e.g. 2.5.7]
  • vue-grid-layout Version: [e.g. 2.3.3]

Describe the bug
A clear and concise description of what the bug is.

Please use the CodeSandbox Template to demonstrate your bug. It is much easier for us to help you if you do.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

复现:

<script> // data.length > 1 function setItemRef(refer) { console.log(refer, "refer"); } </script>
<GridLayout :layout="data">
  <GridItem
    v-for="item in data"
    :x="item.x"
    :y="item.y"
    :w="item.w"
    :h="item.h"
    :i="item.i"
    :key="item.i"
    >
    <span :ref="setItemRef">{{ console.count() }} --</span>
    </GridItem
  >
</GridLayout>
@MikeNo007
Copy link

我在重新渲染gird-item 后 resized(i) 形参i 传递的参数为累加后的结果(比如之前grid-item是两个 重新请求后gird-item重新生成为三个 这是使用 resized 方法 得到的参数 i ) 并没有重新按照grid-item的顺序从0开始 是什么原因

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants