Skip to content

Instantly share code, notes, and snippets.

@zstone12
Created May 13, 2021 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zstone12/f3bb66b212e9393996203aca42011e13 to your computer and use it in GitHub Desktop.
Save zstone12/f3bb66b212e9393996203aca42011e13 to your computer and use it in GitHub Desktop.
<template>
<div class="accept-container">
<div class="go-back" v-show="goBackState" @click="goBack">GoBack</div>
<ul>
<li v-for="item in webAddress" v-bind:key="item">
<a :href="item.link" target="showHere" @click="showIframe">{{item.name}}</a>
</li>
</ul>
<iframe v-show="iframeState" id="show-iframe" frameborder=0 name="showHere" scrolling=auto src=""></iframe>
</div>
</template>
<script>
export default {
name: 'hello',
data () {
return {
iframeState:false,
goBackState:false,
webAddress: [
{
name:'segmentFault',
link:'http://129.204.185.247:3000/d/JI4LEprMz/iominitor?orgId=1 '
},
{
name:'博客',
link:'http://vuex.vuejs.org/'
},
{
name:'特效',
link:'http://www.yyyweb.com/377.html'
}
]
}
},
mounted(){
const oIframe = document.getElementById('show-iframe');
const deviceWidth = document.documentElement.clientWidth;
const deviceHeight = document.documentElement.clientHeight;
oIframe.style.width = deviceWidth + 'px';
oIframe.style.height = deviceHeight + 'px';
},
methods:{
goBack(){
this.goBackState = false;
this.iframeState = false;
},
showIframe(){
this.goBackState = true;
this.iframeState = true;
}
}
}
</script>
<style scoped>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment