👻 A simple example widget

A simple example which you can use as a template for creating your own widget. Takes two optional parameters (text and count), and fetches a list of images from dummyapis.com, and renders the results to the UI.
This commit is contained in:
Alicia Sykes
2021-12-14 19:02:45 +00:00
parent 6df95c9387
commit 3da76ce299
4 changed files with 152 additions and 0 deletions

View File

@@ -116,6 +116,13 @@
@error="handleError"
:ref="widgetRef"
/>
<ExampleWidget
v-else-if="widgetType === 'example'"
:options="widgetOptions"
@loading="setLoaderState"
@error="handleError"
:ref="widgetRef"
/>
<!-- No widget type specified -->
<div v-else>{{ handleError('No widget type was specified') }}</div>
</div>
@@ -145,6 +152,7 @@ import Jokes from '@/components/Widgets/Jokes.vue';
import Flights from '@/components/Widgets/Flights.vue';
import IframeWidget from '@/components/Widgets/IframeWidget.vue';
import EmbedWidget from '@/components/Widgets/EmbedWidget.vue';
import ExampleWidget from '@/components/Widgets/ExampleWidget.vue';
export default {
name: 'Widget',
@@ -167,6 +175,7 @@ export default {
Flights,
IframeWidget,
EmbedWidget,
ExampleWidget,
},
props: {
widget: Object,