鍍金池/ 問答/HTML5  HTML/ 在VUE中使用iframe相對路徑引入本地web頁面,打包后404報錯;

在VUE中使用iframe相對路徑引入本地web頁面,打包后404報錯;

在vue中使用iframe直接引入本地頁面:
<template>

<div>
    <iframe src="../../../static/yuanhoutaiyemian/admin/dk/html/LoanPlatformConfig.html" frameborder="0" width="100%" height="100%"></iframe>
</div>

</template>
本地文件在static文件;不打包,本地起服務運行時沒有問題,打包放到服務器上iframe里面的頁面就404報錯;感覺是路徑問題,打包前將iframe里面的src更改后打包或者外面增加文件夾將本地文件copy到src結構的路徑文件夾中都是嘗試了。。沒有用。

回答
編輯回答
誮惜顏

/static/xxx/xxx/xxx.html 你們確定這樣的方式引入 打包后能正常訪問?不報404了 為啥我的還是404

2017年3月13日 16:14
編輯回答
笑忘初
<iframe src="/static/yuanhoutaiyemian/admin/dk/html/LoanPlatformConfig.html" frameborder="0" width="100%" height="100%"></iframe>
</div>
2017年2月20日 00:11