diff client/src/lib/mixins.js @ 3072:0233845cadb7

client: improved splitscreen mechanis Added possibility to define lifecycle hooks for components in panes. Created Pane component.
author Markus Kottlaender <markus@intevation.de>
date Wed, 17 Apr 2019 10:53:13 +0200
parents 87d34efafb3a
children db890b71f070
line wrap: on
line diff
--- a/client/src/lib/mixins.js	Wed Apr 17 10:51:30 2019 +0200
+++ b/client/src/lib/mixins.js	Wed Apr 17 10:53:13 2019 +0200
@@ -39,4 +39,25 @@
   }
 };
 
-export { sortTable, uuid };
+const paneHooks = {
+  props: {
+    paneCreated: Function,
+    paneMounted: Function,
+    paneUpdated: Function,
+    paneDestroyed: Function
+  },
+  created() {
+    if (this.paneCreated) this.paneCreated();
+  },
+  mounted() {
+    if (this.paneMounted) this.paneMounted();
+  },
+  updated() {
+    if (this.paneUpdated) this.paneUpdated();
+  },
+  destroyed() {
+    if (this.paneDestroyed) this.paneDestroyed();
+  }
+};
+
+export { sortTable, uuid, paneHooks };