@vnejs/plugins.vars 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/modules/vars.js +2 -2
  2. package/package.json +1 -1
package/modules/vars.js CHANGED
@@ -19,10 +19,10 @@ export class Vars extends Module {
19
19
 
20
20
  return isGlobal ? this.emit(this.EVENTS.VARS.GLOBAL_SET, { name: varName, value }) : this.setLocalVar(varName, value);
21
21
  };
22
- onVarGet = async ({ name = "", type = "", isGlobal = false } = {}) => {
22
+ onVarGet = async ({ name = "", type = "", isGlobal = false, state = null } = {}) => {
23
23
  const varName = this.getInnerVarName(name, type);
24
24
 
25
- const value = isGlobal ? await this.emitOne(this.EVENTS.VARS.GLOBAL_GET, { name: varName }) : this.state[varName];
25
+ const value = isGlobal ? await this.emitOne(this.EVENTS.VARS.GLOBAL_GET, { name: varName }) : state ? state.vars[varName] : this.state[varName];
26
26
 
27
27
  return value ?? this.defaultVarValues[type];
28
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.vars",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",