Fine0830 commented on a change in pull request #481:
URL:
https://github.com/apache/skywalking-rocketbot-ui/pull/481#discussion_r622142888
##########
File path: src/views/components/dashboard/charts/chart-edit.vue
##########
@@ -347,14 +350,24 @@ limitations under the License. -->
private isReadSingleValue = false;
private created() {
- this.itemConfig = this.item;
+ this.setDefaultValue((this.itemConfig = this.item));
this.initConfig();
if (!this.itemConfig.independentSelector ||
this.pageTypes.includes(this.type)) {
return;
}
this.setItemServices();
}
+ private setDefaultValue(itemConfig: any) {
+ const keys: string[] = Object.keys(itemConfig);
+ let key: string = '';
+ for (key in this.itemConfigDefault) {
Review comment:
The approach has some downside.
https://stackoverflow.com/questions/500504/why-is-using-for-in-for-array-iteration-a-bad-idea
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]