context.js 399 B

123456789101112131415161718
  1. export var context = {
  2. zIndex: 2000,
  3. lockCount: 0,
  4. stack: [],
  5. find: function find(vm) {
  6. return this.stack.filter(function (item) {
  7. return item.vm === vm;
  8. })[0];
  9. },
  10. remove: function remove(vm) {
  11. var item = this.find(vm);
  12. if (!item) return;
  13. item.vm = null;
  14. item.overlay = null;
  15. var index = this.stack.indexOf(item);
  16. this.stack.splice(index, 1);
  17. }
  18. };