mirror of
https://github.com/chillzhuang/Saber.git
synced 2024-12-23 17:49:27 +08:00
6 lines
11 KiB
JavaScript
6 lines
11 KiB
JavaScript
|
/**
|
||
|
* vuex v3.1.1
|
||
|
* (c) 2019 Evan You
|
||
|
* @license MIT
|
||
|
*/
|
||
|
!function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = t || self).Vuex = e() }(this, function () { "use strict"; var t = ("undefined" != typeof window ? window : "undefined" != typeof global ? global : {}).__VUE_DEVTOOLS_GLOBAL_HOOK__; function e (t, e) { Object.keys(t).forEach(function (n) { return e(t[n], n) }) } var n = function (t, e) { this.runtime = e, this._children = Object.create(null), this._rawModule = t; var n = t.state; this.state = ("function" == typeof n ? n() : n) || {} }, o = { namespaced: { configurable: !0 } }; o.namespaced.get = function () { return !!this._rawModule.namespaced }, n.prototype.addChild = function (t, e) { this._children[t] = e }, n.prototype.removeChild = function (t) { delete this._children[t] }, n.prototype.getChild = function (t) { return this._children[t] }, n.prototype.update = function (t) { this._rawModule.namespaced = t.namespaced, t.actions && (this._rawModule.actions = t.actions), t.mutations && (this._rawModule.mutations = t.mutations), t.getters && (this._rawModule.getters = t.getters) }, n.prototype.forEachChild = function (t) { e(this._children, t) }, n.prototype.forEachGetter = function (t) { this._rawModule.getters && e(this._rawModule.getters, t) }, n.prototype.forEachAction = function (t) { this._rawModule.actions && e(this._rawModule.actions, t) }, n.prototype.forEachMutation = function (t) { this._rawModule.mutations && e(this._rawModule.mutations, t) }, Object.defineProperties(n.prototype, o); var i, r = function (t) { this.register([], t, !1) }; r.prototype.get = function (t) { return t.reduce(function (t, e) { return t.getChild(e) }, this.root) }, r.prototype.getNamespace = function (t) { var e = this.root; return t.reduce(function (t, n) { return t + ((e = e.getChild(n)).namespaced ? n + "/" : "") }, "") }, r.prototype.update = function (t) { !function t (e, n, o) { n.update(o); if (o.modules) for (var i in o.modules) { if (!n.getChild(i)) return; t(e.concat(i), n.getChild(i), o.modules[i]) } }([], this.root, t) }, r.prototype.register = function (t, o, i) { var r = this; void 0 === i && (i = !0); var s = new n(o, i); 0 === t.length ? this.root = s : this.get(t.slice(0, -1)).addChild(t[t.length - 1], s); o.modules && e(o.modules, function (e, n) { r.register(t.concat(n), e, i) }) }, r.prototype.unregister = function (t) { var e = this.get(t.slice(0, -1)), n = t[t.length - 1]; e.getChild(n).runtime && e.removeChild(n) }; var s = function (e) { var n = this; void 0 === e && (e = {}), !i && "undefined" != typeof window && window.Vue && d(window.Vue); var o = e.plugins; void 0 === o && (o = []); var s = e.strict; void 0 === s && (s = !1), this._committing = !1, this._actions = Object.create(null), this._actionSubscribers = [], this._mutations = Object.create(null), this._wrappedGetters = Object.create(null), this._modules = new r(e), this._modulesNamespaceMap = Object.create(null), this._subscribers = [], this._watcherVM = new i; var a = this, c = this.dispatch, u = this.commit; this.dispatch = function (t, e) { return c.call(a, t, e) }, this.commit = function (t, e, n) { return u.call(a, t, e, n) }, this.strict = s; var h = this._modules.root.state; p(this, h, [], this._modules.root), f(this, h), o.forEach(function (t) { return t(n) }), (void 0 !== e.devtools ? e.devtools : i.config.devtools) && function (e) { t && (e._devtoolHook = t, t.emit("vuex:init", e), t.on("vuex:travel-to-state", function (t) { e.replaceState(t) }), e.subscribe(function (e, n) { t.emit("vuex:mutation", e, n) })) }(this) }, a = { state: { configurable: !0 } }; function c (t, e) { return e.indexOf(t) < 0 && e.push(t), function () { var n = e.indexOf(t); n > -1 && e.splice(n, 1) } } function u (t, e) { t._actions = Object.create(null), t._mutations = Object.create(null), t._wrappedGetters = Object.create(null), t._modulesNamespaceMap = Object.create(null); var n = t.state; p(t, n, [], t._modules.root, !0), f(t, n, e) } function f (t, n, o) { var r = t._vm; t.getters = {}; var s = t._wr
|