Adds refresh button to widget, for reloading data

This commit is contained in:
Alicia Sykes
2021-12-13 16:22:24 +00:00
parent ae8179ecd7
commit 2075cbc222
18 changed files with 254 additions and 49 deletions

View File

@@ -1,10 +1,31 @@
import LoadingAnimation from '@/assets/interface-icons/loader.svg';
const WidgetMixin = {
components: {
LoadingAnimation,
},
props: {
/* The options prop is an object of settings for a given widget */
options: {
type: Object,
default: {},
},
},
data: () => ({
loading: true, // Indicates current loading status, to display spinner
}),
methods: {
/* Overridden by widget component. Re-fetches and renders any external data *
* Called by parent component, and triggered either by user or time interval */
update() {
// eslint-disable-next-line no-console
console.log('No update method configured for this widget');
},
},
mounted() {
// If the mounted function isn't overridden,then hide loader
this.loading = false;
},
};
export default WidgetMixin;