aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/index.ts
diff options
context:
space:
mode:
authorpacien2020-09-25 16:01:49 +0200
committerpacien2020-09-25 16:01:49 +0200
commite93f7b1eb84c083d67567115284c0002a3a7d5fc (patch)
tree8d373e8f7f571485e1330928f43b090ed004c525 /viewer/src/components/index.ts
parent8e3ac8fe44bebb38e1882ca7f06b8100078ad88d (diff)
parentfd542f75a1d94ee5f804d0925823276b97f38581 (diff)
downloadldgallery-e93f7b1eb84c083d67567115284c0002a3a7d5fc.tar.gz
Merge branch 'develop' for release v2.0v2.0
Diffstat (limited to 'viewer/src/components/index.ts')
-rw-r--r--viewer/src/components/index.ts17
1 files changed, 10 insertions, 7 deletions
diff --git a/viewer/src/components/index.ts b/viewer/src/components/index.ts
index 559000e..f34eea1 100644
--- a/viewer/src/components/index.ts
+++ b/viewer/src/components/index.ts
@@ -17,18 +17,21 @@
17-- along with this program. If not, see <https://www.gnu.org/licenses/>. 17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18*/ 18*/
19 19
20import Vue from "vue" 20import Vue from "vue";
21 21
22const requireComponent = require.context( 22const requireComponent = require.context(
23 "@/components", 23 "@/components",
24 false, // Whether or not to look in subfolders 24 true, // Whether or not to look in subfolders
25 // The regular expression used to match base component filenames 25 // The regular expression used to match base component filenames
26 /Ld[A-Z]\w+\.vue$/ 26 /Ld[A-Z]\w+\.vue$/
27) 27);
28 28
29requireComponent.keys().forEach(fileName => { 29requireComponent.keys().forEach(fileName => {
30 const componentConfig = requireComponent(fileName) 30 const componentConfig = requireComponent(fileName);
31 const componentName = fileName.split("/").pop()!.replace(/\.vue$/, ""); 31 const componentName = fileName
32 .split("/")
33 .pop()!
34 .replace(/\.vue$/, "");
32 35
33 // Register component globally 36 // Register component globally
34 Vue.component( 37 Vue.component(
@@ -37,5 +40,5 @@ requireComponent.keys().forEach(fileName => {
37 // exist if the component was exported with `export default`, 40 // exist if the component was exported with `export default`,
38 // otherwise fall back to module's root. 41 // otherwise fall back to module's root.
39 componentConfig.default ?? componentConfig 42 componentConfig.default ?? componentConfig
40 ) 43 );
41}) 44});