An object which is passed into the method a plugin provides for declaring a widget decorator via IAssetLinkPluginHandle#defineWidgetDecorator.
Methods
# appliesIf(predicateFn)
Specify a function which determines whether this widget decorator should apply for a given context.
Usage
pageSlot.appliesIf(context => context.asset.attributes.status !== 'archived');
Parameters:
Name | Type | Description |
---|---|---|
predicateFn |
function
|
Determines whether this widget decorator should apply for a given context. |
# component(component)
Specify the component for this plugin-provided slot.
Usage
pageSlot.component(SomeVueComponent);
Parameters:
Name | Type | Description |
---|---|---|
component |
VueComponent
|
The component for this plugin-provided slot.
this can be anything that is valid as the first argument to Vue's |
# targetWidgetName(targetWidgetName)
Specify the name of the widget this decorator applies to.
Usage
widgetDecorator.targetWidgetName('asset-name');
Parameters:
Name | Type | Description |
---|---|---|
targetWidgetName |
String
|
The name of the widget this decorator should apply to. |
# weight(weight)
Specify the weight for this widget decorator.
Usage
pageSlot.weight(50);
Parameters:
Name | Type | Description |
---|---|---|
weight |
Number
|
function
|
The weight of this widget decorator - either a fixed number or a function that takes the context and returns a number. |