Tencent / wepy

小程序组件化开发框架
https://wepyjs.gitee.io/wepy-docs/
Other
22.51k stars 3.05k forks source link

在使用过程中遇到需要循环渲染组件的情况, 目前循环渲染的数据会冲突, 修改一个组件里面的值,其他组件的值也会受到影响 #1589

Closed littleQing closed 6 years ago

littleQing commented 6 years ago

提交ISSUE前请确保已认真阅读以下内容

Please read the following information carefully before you open an issue.

在提交issue之前必须确认以下问题:

Please make sure you understand the following points:

阅读完后请在提交的issue中删除以上内容,包括分割线

DELETE THE INFORMATION ABOVE(INCLUDE THE SEPARATION LINE) BEFORE YOU OPEN AN ISSUE


Description

[问题描述:站在其它人的角度尽可能清晰地、简洁地把问题描述清楚]

[Description of the issue]

Environment

Reproduce

[如何重现问题]

[How to reproduce the issue]

Observed Results

[实际表现]

[Observed Results]

Expected Results

[期望表现]

[Expected Results]

Relevant Code / Logs


  // TODO(you): code or logs here to reproduce the problem
  // 可以使用小程序代码片段功能,方便其它人帮助你定位代码问题
  // 详情可参考这里:https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
  ```
Meowzz95 commented 6 years ago

什么也没提供别人怎么帮你.. 初步怀疑是你的所有组件都指向同一个Object/Object reference?

Ceeson commented 6 years ago

WePY 1.x 版本中,组件使用的是静态编译组件,即组件是在编译阶段编译进页面的,每个组件都是唯一的一个实例,目前只提供简单的 repeat 支持。不支持在 repeat 的组件中去使用 props, computed, watch 等等特性。 数据放入组件中做循环操作,而不是循环使用组件。我是这么理解的,说错望指正。

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. 因为这个 Issue 最近没有任何有效回复,所以被自动标记为了stale。 如果在未来7天依旧没有任何激活操作,那么该 Issue 将会被自动关闭。 感谢您的提问。

mrsunx commented 5 years ago

请问解决了么,我也遇到了