juzhiyuan commented on a change in pull request #167: feature: add array
property editor
URL:
https://github.com/apache/incubator-apisix-dashboard/pull/167#discussion_r404030376
##########
File path: src/components/PluginDialog/index.vue
##########
@@ -242,8 +263,37 @@ export default class extends Vue {
this.rules = rules
+ // Generate initial data and merge current data
+ let schemaKeys = {}
+ for (let key in schema.properties) {
+ if (schema.properties[key].default) {
+ schemaKeys[key] = schema.properties[key].default
+ continue
+ }
+
+ switch (schema.properties[key].type) {
+ case 'array':
+ schemaKeys[key] = []
+ this.arrayPropertiesLength[key] = [...new Array(this.pluginData[key]
? this.pluginData[key].length : schema.properties[key].minItems).keys()]
+ break
+
Review comment:
Please remove the blank line in `switch` statement :)
----------------------------------------------------------------
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]
With regards,
Apache Git Services