Interface

IAssetLinkPluginWidgetDecoratorHandle

IAssetLinkPluginWidgetDecoratorHandle

An object which is passed into the method a plugin provides for declaring a widget decorator via IAssetLinkPluginHandle#defineWidgetDecorator.

View Source assetlink-plugin-api/src/IAssetLinkPluginWidgetDecoratorHandle.js, line 3

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.

View Source assetlink-plugin-api/src/IAssetLinkPluginWidgetDecoratorHandle.js, line 27

# 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 h() function. See Vue's documentation on render functions.

View Source assetlink-plugin-api/src/IAssetLinkPluginWidgetDecoratorHandle.js, line 59

# 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.

View Source assetlink-plugin-api/src/IAssetLinkPluginWidgetDecoratorHandle.js, line 11

# 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.

View Source assetlink-plugin-api/src/IAssetLinkPluginWidgetDecoratorHandle.js, line 44