Skip to content

Commit

Permalink
Stop using $set
Browse files Browse the repository at this point in the history
  • Loading branch information
RoelN committed Oct 8, 2024
1 parent 4b5c9ad commit 2c3c089
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/components/report/FeatureControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default {
state = this.currentStates[feature.tag];
} else {
// No CSS state yet, set to "default" (null)
this.$set(this.currentStates, feature.tag, null);
this.currentStates[feature.tag] = null;
state = null;
}
if (state === null) continue;
Expand All @@ -111,8 +111,9 @@ export default {
}
},
toggleAlternate: function (feature, value) {
this.$set(this.currentStates, feature, value);
this.$set(this.alternateStates, feature, value);
this.currentStates[feature] = value;
this.alternateStates[feature] = value;

this.updateStyles();
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/report/OpenTypeFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
state = this.currentStates[feature];
} else {
// No CSS state yet, create one based off default state
this.$set(this.currentStates, feature, 1);
this.currentStates[feature] = 1;
state = 1;
}
return `font-feature-settings:"${feature}" ${
Expand Down
9 changes: 3 additions & 6 deletions src/components/report/VariableControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
);
this.setAxis("opsz", opszValue);
// If axis was turned off, linking turns it on again
this.$set(this.currentStates, "opsz", true);
this.currentStates["opsz"] = true;
this.updateStyles();
}
},
Expand Down Expand Up @@ -129,11 +129,8 @@ export default {
}
},
flipState(axis, force) {
this.$set(
this.currentStates,
axis,
force || this.currentStates[axis] === false
);
this.currentStates[axis] =
force || this.currentStates[axis] === false;
if (axis === "opsz") {
this.$emit("unlinkOpticalSize");
}
Expand Down

0 comments on commit 2c3c089

Please sign in to comment.