|
@@ -1,5 +1,5 @@
|
|
|
/**
|
|
|
- * vuex v3.1.3
|
|
|
+ * vuex v3.2.0
|
|
|
* (c) 2020 Evan You
|
|
|
* @license MIT
|
|
|
*/
|
|
@@ -129,6 +129,10 @@ Module.prototype.getChild = function getChild (key) {
|
|
|
return this._children[key]
|
|
|
};
|
|
|
|
|
|
+Module.prototype.hasChild = function hasChild (key) {
|
|
|
+ return key in this._children
|
|
|
+};
|
|
|
+
|
|
|
Module.prototype.update = function update (rawModule) {
|
|
|
this._rawModule.namespaced = rawModule.namespaced;
|
|
|
if (rawModule.actions) {
|
|
@@ -221,6 +225,13 @@ ModuleCollection.prototype.unregister = function unregister (path) {
|
|
|
parent.removeChild(key);
|
|
|
};
|
|
|
|
|
|
+ModuleCollection.prototype.isRegistered = function isRegistered (path) {
|
|
|
+ var parent = this.get(path.slice(0, -1));
|
|
|
+ var key = path[path.length - 1];
|
|
|
+
|
|
|
+ return parent.hasChild(key)
|
|
|
+};
|
|
|
+
|
|
|
function update (path, targetModule, newModule) {
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
|
assertRawModule(path, newModule);
|
|
@@ -517,6 +528,16 @@ Store.prototype.unregisterModule = function unregisterModule (path) {
|
|
|
resetStore(this);
|
|
|
};
|
|
|
|
|
|
+Store.prototype.hasModule = function hasModule (path) {
|
|
|
+ if (typeof path === 'string') { path = [path]; }
|
|
|
+
|
|
|
+ if (process.env.NODE_ENV !== 'production') {
|
|
|
+ assert(Array.isArray(path), "module path must be a string or an Array.");
|
|
|
+ }
|
|
|
+
|
|
|
+ return this._modules.isRegistered(path)
|
|
|
+};
|
|
|
+
|
|
|
Store.prototype.hotUpdate = function hotUpdate (newOptions) {
|
|
|
this._modules.update(newOptions);
|
|
|
resetStore(this, true);
|
|
@@ -1041,7 +1062,7 @@ function getModuleByNamespace (store, helper, namespace) {
|
|
|
var index = {
|
|
|
Store: Store,
|
|
|
install: install,
|
|
|
- version: '3.1.3',
|
|
|
+ version: '3.2.0',
|
|
|
mapState: mapState,
|
|
|
mapMutations: mapMutations,
|
|
|
mapGetters: mapGetters,
|