当前位置:网站首页>V-for img SRC rendering fails
V-for img SRC rendering fails
2022-07-07 11:08:00 【Have a good time I】
Problem description :
An array is defined , The path with pictures in the array , Use for When the page is rendered in a loop , The picture path is right, but the picture does not show .
terms of settlement : The path of the image in the array should be written as follows :
image:require('../assets/img/login.png')
Write when rendering
<img :src="item.image" />
Specific examples
<a-menu
v-for="(v, i) in navData"
:key="i"
:default-selected-keys="['/account/home']"
:selected-keys="[v.key]"
mode="inline"
type="inner"
class="accout_menu"
@openChange="onOpenChange"
>
<a-menu-item key="v.key">
<router-link :to="{ name: v.name }">
<img :src="v.src" class="menu_account_image" />
<span class="menu_account_title">{
{
v.title }}</span>
</router-link>
</a-menu-item>
</a-menu>
data() {
return{
navData: [
{
key: '/account/home', name: 'account/home', src: require('@/assets/image/account/home.png'), title: ' home page ' },
{
key: '/account/consumptive-volume',
name: 'account/consumptiveVolume',
src: require('@/assets/image/account/consumptiveVolume.png'),
title: ' Card and voucher management '
},
{
key: '/account/order',
name: 'account/order',
src: require('@/assets/image/account/order.png'),
title: ' Order management '
},
{
key: '/account/bill',
name: 'account/bill',
src: require('@/assets/image/account/bill.png'),
title: ' Transaction records '
},
{
key: '/account/community',
name: 'account/community',
src: require('@/assets/image/account/community.png'),
title: ' My circle '
},
{
key: '/account/message',
name: 'account/message',
src: require('@/assets/image/account/message.png'),
title: ' Message center '
},
{
key: '/account/base-setting',
name: 'account/baseSetting',
src: require('@/assets/image/account/baseSetting.png'),
title: ' Account Center '
}
]
}
}
```
边栏推荐
猜你喜欢

Mysql的json格式查询

ADB utility commands (network package, log, tuning related)
![[untitled]](/img/f9/18b85ad17d4c560f2b9d95a53ee72a.jpg)
[untitled]

Deeply understand the characteristics of database transaction isolation

IDEA快捷键大全

Shardingsphere sub database and table examples (logical table, real table, binding table, broadcast table, single table)

2022年7月10日“五心公益”活动通知+报名入口(二维码)

Using tansformer to segment three-dimensional abdominal multiple organs -- actual battle of unetr

Cluster task scheduling system lsf/sge/slurm/pbs based on HPC scenario
![[untitled]](/img/c2/d70d052b7e9587dc81c622f62f8566.jpg)
[untitled]
随机推荐
Cluster task scheduling system lsf/sge/slurm/pbs based on HPC scenario
China Southern Airlines pa3.1
P2788 math 1 - addition and subtraction
Unable to open kernel device '\.\vmcidev\vmx': operation completed successfully. Reboot after installing vmware workstation? Module "devicepoweron" failed to start. Failed to start the virtual machine
2022.7.4DAY596
[recommendation system 01] rechub
How to get hardware information in unity
Rolling puddle Uni_ App (VIII)
【pyqt】tableWidget里的cellWidget使用信号与槽机制
ADB utility commands (network package, log, tuning related)
[machine learning 03] Lagrange multiplier method
SQL Server knowledge collection 11: Constraints
Galaxy Kirin desktop operating system installation postgresql13 (source code installation)
SQL Server 知识汇集9 : 修改数据
seata 1.3.0 四种模式解决分布式事务(AT、TCC、SAGA、XA)
Network foundation (1)
Une fois que l'uniapp a sauté de la page dans onlaunch, cliquez sur Event Failure resolution
Go slice comparison
Network engineer test questions and answers in May of the first half of 2022
Cmake learning manual