1、iframe嵌入地址后,訪問報錯:Permission was denied for this request to access theunknownaddress space.
處理方案:加上allow="local-network-access",如:
<template>
<iframe
class="myiframe"
frameborder="no"
border="0"
marginwidth="0"
marginheight="0"
allowfullscreen
:src="url"
allow="local-network-access"
></iframe>
</template>
<style lang="scss" scoped>
.myiframe {
position: fixed;
top: 0;
left: 0;
width: 100vw;
min-width: 100vw;
max-width: 100vw;
height: 100vh;
min-height: 100vh;
max-height: 100vh;
border: none;
overflow: hidden;
margin: 0;
padding: 0;
}
</style>
2、本地運(yùn)行iframe報錯:The request client is not a secure context and the resource is in more-private address space `local`
處理方案,給devServer打開https,如:
devServer: {
https: true,
...