chore(docs): Added stack info to part configuration docs
This commit is contained in:
parent
96ced472e4
commit
485a29b393
2 changed files with 39 additions and 1 deletions
|
@ -11,4 +11,4 @@ can provide the following configuration properties:
|
|||
- [`measurements` and `optionalMeasurements`](/reference/api/part/config/measurements) lists the part's required or optional measurements
|
||||
- [`options`](/reference/api/part/config/options) lists the part's options
|
||||
- [`plugins`](/reference/api/part/config/plugins) lists the part's required plugins
|
||||
|
||||
- [`stack`](/reference/api/part/config/stack) assigns the part to a stack
|
||||
|
|
38
markdown/dev/reference/api/part/config/stack/en.md
Normal file
38
markdown/dev/reference/api/part/config/stack/en.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: Assigning parts to stacks
|
||||
---
|
||||
|
||||
The optional `stack` property assigns the part to a specific
|
||||
[Stack](/reference/api/stack).
|
||||
|
||||
It holds either a string with the stack name or a function which
|
||||
returns the stack name:
|
||||
|
||||
```js
|
||||
const part = {
|
||||
name: 'example.front',
|
||||
stack: 'example.combined',
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
const part = {
|
||||
name: 'example.back',
|
||||
stack: ({options}) => options.stack ? 'example.combined' : 'example.back',
|
||||
}
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
If `stack` is present, the part is assigned to the stack with the
|
||||
specified name.
|
||||
If multiple parts are assigned to the same stack, they will overlap
|
||||
in drafting and printing layouts.
|
||||
This is because parts in the stack are drafted within the same stack
|
||||
space.
|
||||
|
||||
Otherwise, if the `stack` property is not present, the default behavior
|
||||
is to assign the part to its own stack.
|
||||
The part will not overlap other parts in drafting and printing layouts.
|
||||
This is because it is the only part drafted within its stack and
|
||||
because stacks do not overlap other stacks.
|
Loading…
Add table
Add a link
Reference in a new issue