Add deep-select component and fix a popup bug. (#103)

* feat: new deep select

* fix: add deep-select test

* fix: import

* fix: icon import
This commit is contained in:
WyTiny
2017-09-01 10:15:53 +08:00
committed by Yao
parent c594091955
commit 1418117681
10 changed files with 392 additions and 15 deletions
+9 -13
View File
@@ -1,12 +1,7 @@
import Vue from 'vue';
let context;
const _global = Vue.prototype.$isServer ? global : window;
if (_global && _global.popupContext) {
context = _global.popupContext;
}
const DEFAULT_CONTEXT = {
idSeed: 1,
zIndex: 2000,
@@ -15,23 +10,24 @@ const DEFAULT_CONTEXT = {
modalStack: []
};
context = _global.popupContext = {
...DEFAULT_CONTEXT,
...context
};
if (!_global.popupContext) {
_global.popupContext = {
...DEFAULT_CONTEXT
};
}
const PopupContext = {
getContext(key) {
return context[key];
return _global.popupContext[key];
},
setContext(key, value) {
context[key] = value;
_global.popupContext[key] = value;
},
plusKeyByOne(key) {
const oldVal = +context[key];
context[key] = oldVal + 1;
const oldVal = +_global.popupContext[key];
_global.popupContext[key] = oldVal + 1;
return oldVal;
}