可以的,
代码示例:
<template>
<div id=”app”>
<iframe
style=”border:none”
: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>
css 删除按钮,css before乱码,初次加载翻转css,UI自动生成CSS样式,css页面属性的值,css ul li 下拉框,cssdiv向上