大家好,今天小编关注到一个比较有意思的话题,就是关于使用vue搭建网站的问题,于是小编就整理了2个相关介绍使用vue搭建网站的解答,让我们一起看看吧。
vue iframe能嵌入网址吗?
可以的,
代码示例:
<template>
<div id="app">
<iframe
:width="searchTableWidth"
:height="searchTableHeight"
v-bind:src="reportUrl"
></iframe>
</div>
</template>
<script>
import Vue from 'vue'
export default {
methods: {
widthHeight() {
this.searchTableHeight = window.innerHeight -146;
this.searchTableWidth = window.innerWidth - 280
},
},
data() {
return {
reportUrl: '',
searchTableHeight: 0,
searchTableWidth: 0
}
},
mounted() {
window.onresize = () => {
this.widthHeight(); // 自适应高宽度
};
this.$nextTick(function () {
this.widthHeight();
});
},
created() {
// 从路由里动态获取 url地址 具体地址看libs下util.js里的 backendMenuToRoute 方法
this.reportUrl = this.$route.meta.pathUrl
},
watch: {
'$route': function () {
// 监听路由变化
this.reportUrl = this.$route.meta.pathUrl
}
}
}
</script>
1. 能够嵌入网址
2. 因为Vue框架支持使用iframe标签来嵌入其他网页,包括外部网址。
3. 通过使用Vue的组件和指令,可以轻松地在Vue应用程序中嵌入iframe,并且可以通过设置iframe的src属性来指定要嵌入的网址。
这样可以实现在Vue应用程序中展示其他网页的功能。
掘金这个网站是用了nodejs+vue做出来的吗?
这个网站具体用什么做出来的,不好去推测,如果想知道的话可以下载相应的前端插件,vue-devtools 或者 react 的去看看能不能查看到相关框架属性内容就知道了。
但是您所描述的这些效果可以用 vue + nodejs 实现的 SSR ,附带使用 webapi 的接口中的 history 的 pushState 或者 replaceState去实现。
当然前端也可以不使用 vue,其他框架均可,更快捷点用 php 框架套娃出来一样能够解决这个问题,只是记得使用 webapi 保持更换 url 即可。
到此,以上就是小编对于使用vue搭建网站的问题就介绍到这了,希望介绍关于使用vue搭建网站的2点解答对大家有用。
还没有评论,来说两句吧...