You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
wepy 1.X版本,使用repeat对自定义组件进行循环渲染时,无法将父组件的data双向绑定到子组件上,即repeat不支持props,computed,key值等等;而原生小程序的wx:for只支持原生组件。
目前的解决方案是: 使用repeat将父组件的data动态绑定(:sync.item)到子组件上,在子组件上添加一个事件发射器(this.$emit()),最后在父组件添加对应的events,从而达到数据的'伪'双向绑定。即修改数据的具体代码放在父组件上,而子组件拥有是否修改数据的控制权。
注:无法为子组件绑定key值,但可以为子组件绑定id,从而解决事件发射器的参数问题)
The text was updated successfully, but these errors were encountered: