Creates an embedable webpage widget

This commit is contained in:
Alicia Sykes
2021-12-13 14:03:39 +00:00
parent d9759c06b3
commit ae8179ecd7
3 changed files with 99 additions and 62 deletions

View File

@@ -0,0 +1,35 @@
<template>
<div class="iframe-widget">
<iframe v-if="frameUrl" :src="frameUrl" />
</div>
</template>
<script>
import WidgetMixin from '@/mixins/WidgetMixin';
import ErrorHandler from '@/utils/ErrorHandler';
export default {
mixins: [WidgetMixin],
computed: {
frameUrl() {
const usersChoice = this.options.url;
if (!usersChoice || typeof usersChoice !== 'string') {
ErrorHandler('Iframe widget expects a URL');
return null;
}
return usersChoice;
},
},
};
</script>
<style scoped lang="scss">
.iframe-widget {
iframe {
width: 100%;
min-height: 240px;
border: 0;
}
}
</style>