Adds option to specify height of frame widget

This commit is contained in:
Alicia Sykes 2021-12-25 22:12:11 +00:00 committed by Alicia Sykes
parent 83f61bec19
commit c591a03f66
2 changed files with 940 additions and 931 deletions

View File

@ -785,6 +785,7 @@ Embed any webpage into your dashboard as a widget.
**Field** | **Type** | **Required** | **Description**
--- | --- | --- | ---
**`url`** | `string` | Required | The URL to the webpage to embed
**`frameHeight`** | `number` | _Optional_ | If needed, specify height of iframe in `px`. E.g. `400`, defaults to auto
##### Example

View File

@ -1,6 +1,11 @@
<template>
<div class="iframe-widget">
<iframe v-if="frameUrl" :src="frameUrl" :id="frameId" />
<iframe
v-if="frameUrl"
:src="frameUrl"
:id="frameId"
:style="frameHeight ? `height: ${frameHeight}px` : ''"
/>
</div>
</template>
@ -19,6 +24,9 @@ export default {
}
return usersChoice;
},
frameHeight() {
return this.options.frameHeight;
},
/* Generates an ID for the iframe */
frameId() {
return `iframe-${btoa(this.frameUrl || 'empty').substring(0, 16)}`;