我无法使用LWC在HTML中显示静态资源图像。下面是文件。请指导我解决这个问题。
<lightning-card> <img src={profilePic}/> </lightning-card> JS文件
import { LightningElement,track } from 'lwc';
import staticResourceImage from '@salesforce/resourceUrl/Static_Images';
export default class MyComponent extends LightningElement {
profilePic = staticResourceImage+'/avatar.png' ;
}静态资源:静态资源创建
提前谢谢,
发布于 2022-01-10 12:24:02
将/avatar.png更新代码删除为profilePic = staticResourceImage;
https://stackoverflow.com/questions/64040415
复制相似问题