mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Created Design: Node settings (markdown)
parent
70ea7055f3
commit
d2cb10e3f1
26
Design:-Node-settings.md
Normal file
26
Design:-Node-settings.md
Normal file
@ -0,0 +1,26 @@
|
||||
/settings API returns only the following built-in fields by default.
|
||||
|
||||
http://nodered.jp/docs/api/admin/methods/get/settings/
|
||||
|
||||
A node can add their own settings to the above settings.
|
||||
|
||||
### Adding a setting
|
||||
The way to register a node is as follows (https://nodered.org/docs/creating-nodes/first-node).
|
||||
|
||||
`RED.nodes.registerType("lower-case",LowerCaseNode);`
|
||||
|
||||
To add a node setting, add setting object.
|
||||
```
|
||||
RED.nodes.registerType("lower-case",LowerCaseNode,{
|
||||
settings: {
|
||||
lowerCaseLength:{
|
||||
value: "10",
|
||||
exportable: true
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
* `value` - The value corresponding with the object name.
|
||||
* `exportable` - Whether the value will be output or not.
|
||||
|
||||
### Overwriting a node setting by settings.js
|
Loading…
Reference in New Issue
Block a user