uniapp code <template> <view> <image v-for="(item, i) in fileList" :key="item[urlKey]" :src="item[urlKey]"></image> </view> </template> <script> export default { props: { urlKey: {default: 'url'}, fileList: Array } } </script> Compile to WeChat applet <view> <block wx:for="{{fileList}}" wx:for-item="item" wx:for-index="i" wx:key="urlKey"> <image src="{{item[urlKey]}}"></image> </block> </view> It seems that the syntax of: key="item[urlKey]" is not supported Solution: <template> <view> <image v-for="(item, i) in fileList" :key="key(item)" :src="item[urlKey]"></image> </view> </template> <script> export default { props: { urlKey: {default: 'url'}, fileList: Array }, computed: { key() { return e => e[this.urlKey] } } } </script> This can be solved using computed This is the end of this article about the uniapp WeChat applet: solution to the problem of key expiration. For more relevant content about the uniapp applet key expiration, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: foreman ubuntu16 quick installation
>>: Solution to MySQL remote connection failure
union execution For ease of analysis, use the fol...
In the horizontal direction, you can set the cell...
<br />In order to manage the vehicles enteri...
This article introduces the installation of Windo...
Table of contents 1. Introduce cases 2. View the ...
Business scenario: Use vue + element ui's el-...
introduce HTML provides the contextual structure ...
I think the commands I use most often are: Choice...
1. useState: Let functional components have state...
Introduction to Debian Debian in a broad sense re...
We all know that we need to understand the proper...
This tutorial shares the installation and configu...
Preface Every good habit is a treasure. This arti...
Table of contents Examples from real life Slow qu...
Organize the MySQL 5.5 installation and configura...