👻 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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user