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
Install mysql5.7.21 in the window environment. Th...
1. Reasons If the system is Centos7.3, the Docker...
1. Install Docker on the server yum install docke...
Nested use of MySQL ifnull I searched online to s...
The three-dimensional column chart consists of th...
Preface: When designing a table in MySQL, MySQL o...
This article uses examples to illustrate the pitf...
Today we are going to create a simple heartbeat e...
Table of contents Preface 1. Tomcat class loader ...
mysql full backup 1. Enable binary log and separa...
Recorded the installation tutorial of mysql 5.7.1...
Learning objectives: Learn to use Windows system ...
If this is the first time you install MySQL on yo...
Table of contents 1 element offset series 1.1 Off...
Table of contents As a global variable Variable H...