cartodb-4.42/lib/assets/javascripts/new-dashboard/components/InjectableIframe.vue
2024-04-06 05:25:13 +00:00

31 lines
571 B
Vue

<template>
<iframe ref="iframe" frameborder="0" :height="height" :width="width"></iframe>
</template>
<script>
export default {
name: 'InjectableIframe',
mounted () {
this.setContent();
},
props: {
content: String,
height: String,
width: String
},
methods: {
setContent () {
const docIframe = this.$refs.iframe.contentWindow.document;
docIframe.open('text/html', 'replace');
docIframe.write(this.content);
docIframe.close();
}
},
watch: {
content () {
this.setContent();
}
}
};
</script>