Using iframeResizer in a Vue.js Component
September 26, 2019•54 words
Using the iframeresizer library in a Vue.js component
<template>
<div>
<iframe id="myiframe" :src="http://example.com/url/of/page"></iframe>
</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import iframeResizer from "iframe-resizer";
@Component({})
export default class IframeComponent extends Vue {
mounted() {
this.resize();
}
resize() {
(iframeResizer as any).iframeResizer({ checkOrigin: false }, "#myiframe");
}
}
</script>