From 6e7ee4d38fb3630a13d31592f0f6ae9bbe8e1bd6 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Sat, 21 Dec 2019 03:32:20 +0100
Subject: Implemented global components registration Moved the fullscreen
button as a global component (as demonstration) Improved the layout CSS
---
viewer/src/components/LdButtonFullscreen.vue | 25 +++++++++++++++++++++++++
viewer/src/components/index.ts | 22 ++++++++++++++++++++++
2 files changed, 47 insertions(+)
create mode 100644 viewer/src/components/LdButtonFullscreen.vue
create mode 100644 viewer/src/components/index.ts
(limited to 'viewer/src/components')
diff --git a/viewer/src/components/LdButtonFullscreen.vue b/viewer/src/components/LdButtonFullscreen.vue
new file mode 100644
index 0000000..2302a27
--- /dev/null
+++ b/viewer/src/components/LdButtonFullscreen.vue
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/viewer/src/components/index.ts b/viewer/src/components/index.ts
new file mode 100644
index 0000000..1406b34
--- /dev/null
+++ b/viewer/src/components/index.ts
@@ -0,0 +1,22 @@
+import Vue from 'vue'
+
+const requireComponent = require.context(
+ '@/components',
+ false, // Whether or not to look in subfolders
+ // The regular expression used to match base component filenames
+ /Ld[A-Z]\w+\.vue$/
+)
+
+requireComponent.keys().forEach(fileName => {
+ const componentConfig = requireComponent(fileName)
+ const componentName = fileName.split('/').pop()!.replace(/\.vue$/, '');
+
+ // Register component globally
+ Vue.component(
+ componentName,
+ // Look for the component options on `.default`, which will
+ // exist if the component was exported with `export default`,
+ // otherwise fall back to module's root.
+ componentConfig.default || componentConfig
+ )
+})
\ No newline at end of file
--
cgit v1.2.3