Skip to content

Commit

Permalink
SMM-32 add external vue components config option
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Wacławczyk committed Dec 17, 2024
1 parent 5a4bf43 commit 0cf9875
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Bump cross-spawn from 7.0.3 to 7.0.6 ([#349](https://github.com/SnowdogApps/magento2-menu/pull/349))
- Add missing $escaper and $viewModels declarations ([#350](https://github.com/SnowdogApps/magento2-menu/pull/350))
- Import categories by store view ([#352](https://github.com/SnowdogApps/magento2-menu/pull/352))
- Add external vue providers config option

## [2.27.2] - 2024-11-08
### Fixed
Expand Down
15 changes: 14 additions & 1 deletion Model/VueProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@ class VueProvider
*/
private $components;

/**
* 3rd party extensions have to provide full path
*
* @var array
*/
private $externalComponents;

/**
* @param array $components
* @param array $externalComponents
*/
public function __construct(
array $components = []
array $components = [],
array $externalComponents = []
) {
$this->components = $components;
$this->externalComponents = $externalComponents;
}

/**
Expand All @@ -31,6 +41,9 @@ public function getComponents(): array
foreach ($this->components as $component) {
$data[] = sprintf(self::COMPONENT_PATH, $component);
}
foreach ($this->externalComponents as $externalComponent) {
$data[] = $externalComponent;
}

return $data;
}
Expand Down

0 comments on commit 0cf9875

Please sign in to comment.