angularjs – Ionic v1中的img src路径
发布时间:2020-12-17 17:02:56 所属栏目:安全 来源:网络整理
导读:我正在使用离子v1 这是我的文件夹结构. wwwtempaltesacct 在我的acct文件夹下,我有acct-home.html和patient_default.png 我试图使用此代码在acct-home中显示我的patient_default.png. img src="patient_default.png" alt="Test" width="100px" height="10
我正在使用离子v1
这是我的文件夹结构. wwwtempaltesacct 在我的acct文件夹下,我有acct-home.html和patient_default.png 我试图使用此代码在acct-home中显示我的patient_default.png. <img src="patient_default.png" alt="Test" width="100px" height="100px"> 请注意,acct-home.html和patient_default.png位于同一文件夹中. 更新的问题: 这是我的文件夹结构 root --API --patient_default.png --Www --templates --acct --acct-home.html 我试过用 <img src="../../API/patient_default.png" alt="Test" width="100px" height="100px"> 它什么都没显示. 解决方法
使用src =“patient_default.png”类型,您只能在索引或应用程序启动视图中访问….但在您的情况下,您需要从子文件夹访问.为此您需要显示src属性的正确路径比如src =“../你的图像包含文件夹/logo.png”.这就像反向显示方向一样.
并为您的更新你需要将../增加到该文件夹??,就像假设“../your image containingfolder /logo.png”从你的www文件夹中指示你需要添加一个更像“../../你的图像包含文件夹/ logo.png“加入他们,但要确保他们在那个位置可用 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |