mirror of
https://github.com/Lissy93/dashy.git
synced 2024-12-29 20:11:53 +03:00
⚡ Adds option to specify height of frame widget
This commit is contained in:
parent
90dd351756
commit
c99c517262
@ -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
|
||||
|
||||
|
@ -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)}`;
|
||||
|
Loading…
Reference in New Issue
Block a user