Skip to content

Commit 9121cbf

Browse files
authored
Adding New Settings (#20)
On `docs/editor-components/settings.md` added how to add one or more settings fields
1 parent ee665dc commit 9121cbf

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/editor-components/settings.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,29 @@ const fontSize = settings.get('fontSize');
2424
const theme = settings.get('appTheme');
2525
```
2626

27+
### Adding New Fields
28+
29+
Add one field or more then one subfields using `value[]` attribute:
30+
31+
```js
32+
// make sure to follow proper JSON syntax, these fields will be directly added to settings
33+
34+
// syntax
35+
settings.value["your-superkey"] = {
36+
key: value,
37+
key: value
38+
// repeat as per your needs
39+
}
40+
41+
// Example Use
42+
settings.value["my-acode-plugin.id"] = {
43+
fontSize: "16px",
44+
port: 5000,
45+
user: "john doe"
46+
}
47+
```
48+
49+
2750
### Updating Settings
2851

2952
Update one or more settings using the `update()` method:

0 commit comments

Comments
 (0)