使用iframe
标签,如果是外部的链接,比如百度就直接写地址,如果是自己的本地html,就放在后端的public
里面
代码如下:
HTML
<iframe
id="iframeId" :src="url" frameborder="0" class="pc iframe" scrolling="auto">
</iframe>
JS
data() {
return {
url:"http://localhost:7001/public/clock1.0.0.html"
}
},
CSS
修改位置大小
.iframe {
position: absolute;
/* left: 0; */
right: 10px;
top: 20px;
bottom: 0;
width: 20%;
height: 20%;
background: #fff;
overflow-y: hidden;
}