Skip to content

Commit

Permalink
add wx:key for foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
tzj committed Oct 15, 2018
1 parent 796956e commit 8e3a3da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pages/joke/joke.wxml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<import src="../common/common.wxml"/>

<scroll-view scroll-y="true" class="page-body" bindscrolltolower="loadMore" lower-threshold="100">
<template is="jokeItem" data="{{item}}" wx:for="{{jokeList}}"/>
<template is="jokeItem" data="{{item}}" wx:for="{{jokeList}}" wx:key="*this"/>
<template is="loadindFooter" data="{{hideFooter}}"/>
</scroll-view>

Expand Down
2 changes: 1 addition & 1 deletion pages/picture/picture.wxml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<import src="../common/common.wxml"/>

<scroll-view scroll-y="true" class="page-body" bindscrolltolower="loadMore" lower-threshold="100">
<template is="pictureItem" data="{{item,preview}}" wx:for="{{picList}}"/>
<template is="pictureItem" data="{{item,preview}}" wx:for="{{picList}}" wx:key="*this"/>
<template is="loadindFooter" data="{{hideFooter}}"/>
</scroll-view>

Expand Down

0 comments on commit 8e3a3da

Please sign in to comment.