Skip to content

Commit 7efc964

Browse files
committed
Solved problem connected with global configs.
1 parent c4da871 commit 7efc964

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"name": "vue-functional-calendar",
88
"description": "Lightweight, high-performance calendar component based on Vue.js",
9-
"version": "2.6.9",
9+
"version": "2.7.0",
1010
"license": "MIT",
1111
"repository": {
1212
"type": "git",

src/Demo.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
22
<div>
3+
<functional-calendar class="demo-calendar" :is-date-picker="true" :with-time-picker="true">
4+
5+
</functional-calendar>
36
<FunctionalCalendar class="demo-calendar"
47
ref="Calendar"
58
:hiddenElements="['']"

src/components/FunctionalCalendar.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,18 +358,15 @@
358358
},
359359
setConfigs() {
360360
let vm = this;
361-
let globalOptions;
362361
if (typeof vm.$getOptions !== "undefined") {
363362
// Global Options
364-
globalOptions = vm.$getOptions();
365-
Object.keys(globalOptions).map(function (objectKey) {
363+
Object.keys(vm.$getOptions()).map(function (objectKey) {
366364
if (typeof (vm.fConfigs[objectKey]) !== "undefined") {
367-
vm.$set(vm.fConfigs, objectKey, globalOptions[objectKey]);
365+
vm.$set(vm.fConfigs, objectKey, vm.$getOptions()[objectKey]);
368366
}
369367
});
370368
}
371369
372-
373370
if (typeof (vm.configs) !== "undefined") {
374371
Object.keys(vm.fConfigs).map(function (objectKey) {
375372
if (typeof (vm.configs[objectKey]) !== "undefined") {
@@ -379,12 +376,15 @@
379376
});
380377
} else {
381378
Object.keys(vm.$props).map(function (objectKey) {
382-
if (typeof (vm.fConfigs[objectKey]) !== "undefined" && typeof (vm.$props[objectKey]) !== "undefined") {
379+
if (typeof (vm.fConfigs[objectKey]) !== "undefined" &&
380+
typeof (vm.$props[objectKey]) !== "undefined" &&
381+
typeof (vm.$getOptions()[objectKey]) === "undefined") {
383382
vm.$set(vm.fConfigs, objectKey, vm.$props[objectKey]);
384383
}
385384
});
386385
}
387386
387+
388388
// Is Modal
389389
if (vm.fConfigs.isModal) vm.showCalendar = false;
390390

src/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import Vue from "vue";
22
import FunctionalCalendar from "../index";
33
import Demo from "./Demo";
44
Vue.use(FunctionalCalendar, {
5-
dayNames: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
5+
showWeekNumbers: true,
6+
dayNames: ["Երկ.", "Tu", "We", "Th", "Fr", "Sa", "Su"]
67
});
78
Vue.config.productionTip = false;
89

0 commit comments

Comments
 (0)