大佬教程收集整理的这篇文章主要介绍了Framework7 + Cordova |使 iframe 打开本地文件,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
大家好。
我正在使用 Framework7 制作应用程序。 有路由。我得到了组件“page.f7.HTML”和名为“1”的文件夹,里面有“index.f7.HTML”,文件夹“data”里面有“script.Js”(.pptx文件转换为.HTML)。
--page.f7.HTML
--1
|
--index.f7.HTML
--data
|
--scripts.Js
我需要将 iframe 添加到我的组件中,所以我的 page.f7.HTML 看起来像这样:
<template>
<div class="page">
<div class="navbar">
<div class="navbar-bg"></div>
<div class="navbar-inner slIDing">
<div class="left">
<a href="#" class="link BACk">
<i class="icon icon-BACk"></i>
<span class="if-not-md">BACk</span>
</a>
</div>
<div class="title">Задача 1</div>
</div>
</div>
<div class="page-content">
<iframe style="wIDth: 100vw;height: calc(100vh - 110pX);" ID="frame-pptx" src="/lessons/tasks/1/index.f7.HTML" frameborder="0"></iframe>
</div>
</div>
</template>
<script>
export default () => {
return $render;
};
</script>
但是,iframe 不起作用。我得到的错误是:
Screen: CAnnot GET /lessons/tasks/1/index.f7.HTML Console: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/lessons/tasks/1/index.f7.HTML
我尝试了另一种选择 - 路由到 index.f7.HTML
<iframe style="wIDth: 100vw;height: calc(100vh - 110pX);" ID="frame-pptx" src="/lessons/tasks/cont/1/" frameborder="0"></iframe>
这里我从控制台收到两个错误:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (http://localhost:8080/lessons/tasks/cont/1/Js/app.Js,line 0) [Error] Refused to execute http://localhost:8080/lessons/tasks/cont/1/Js/app.Js as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type.
由于某些原因使得寻求Js/app.Js
我正在寻求您的帮助或建议。我需要更改或修复什么?
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的Framework7 + Cordova |使 iframe 打开本地文件全部内容,希望文章能够帮你解决Framework7 + Cordova |使 iframe 打开本地文件所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。