Skip to content

Commit

Permalink
add -- option withFlatten
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix committed Jan 27, 2021
1 parent e0d6ccc commit d47a2d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ Here are a few customization options
- `->withPlaceholder(string $placeholder)` // - placeholder in tree select
- `->withMaxHeight(int $maxHeight)`
- `->withSortValueBy(string $sortBy)` // - @see https://vue-treeselect.js.org/#flat-mode-and-sort-values
- `->withAlwaysOpen(boot $alwaysOpen)` // - by default select is open, but you can change it behavior
- `->withAlwaysOpen(bool $alwaysOpen)` // - by default select is open, but you can change it behavior
- `->withFlatten(bool $flatten)` // - by default flatten is enabled, but you can change it behavior
- `->useSingleSelect()` // - ability for select only one value


Expand Down
9 changes: 9 additions & 0 deletions src/NestedTreeAttachManyField.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ public function withSortValueBy(string $sortBy): NestedTreeAttachManyField
return $this;
}

public function withFlatten(bool $flatten): NestedTreeAttachManyField
{
$this->withMeta([
'flatten' => $flatten,
]);

return $this;
}

public function useSingleSelect(): NestedTreeAttachManyField
{
$this->withMeta([
Expand Down

0 comments on commit d47a2d8

Please sign in to comment.