The local web page is introduced using iframe relative path in VUE, and the error is reported after packaging.

introduce local pages directly using iframe in vue:
< template >

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

< / template >
the local file is in the static file. If the local service is not packaged, there will be no problem when the service is run. The page inside the iframe on the server will report an error if it is packaged. It feels like a path problem. It is an attempt to change the src inside the iframe before packaging or add a folder outside to copy the local file to the path folder of the src structure. No, no, no. useless.

Nov.19,2021

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

/ static/xxx/xxx/xxx.html are you sure you can access it normally after it is introduced into packaging? Why is mine still 404?


have you finally solved the problem? I can't use the absolute path

.
Menu