Interface

IAssetLinkPluginSlotHandle

IAssetLinkPluginSlotHandle

An object which is passed into the method a plugin provides for declaring a slot via IAssetLinkPluginHandle#defineSlot.

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

Methods

# 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/IAssetLinkPluginSlotHandle.js, line 73

# multiplexContext(contextMultiplexerFn)

Specify a function that allows this slot to render multiple times with different inputs.

Usage

pageSlot.multiplexContext(context => context.asset.nickname);
Parameters:
Name Type Description
contextMultiplexerFn function

A function which allows a slot to "fan out" and render multiple times with different inputs.

View Source assetlink-plugin-api/src/IAssetLinkPluginSlotHandle.js, line 41

# showIf(predicateFn)

Specify a function which determines whether this slot should apply for a given context.

Usage

pageSlot.showIf(context => context.asset.attributes.status !== 'archived');
Parameters:
Name Type Description
predicateFn function

Determines whether this slot should apply for a given context.

View Source assetlink-plugin-api/src/IAssetLinkPluginSlotHandle.js, line 26

# type(type)

Specify the type of this slot.

Usage

pageSlot.type("page-slot");
Parameters:
Name Type Description
type String

The path of this plugin-provided route. See https://router.vuejs.org/guide/essentials/dynamic-matching.html for route path format.

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

# weight(weight)

Specify the weight for this plugin-provided slot.

Usage

pageSlot.weight(50);
Parameters:
Name Type Description
weight Number | function

The weight of this slot - either a fixed number or a function that takes the context and returns a number.

View Source assetlink-plugin-api/src/IAssetLinkPluginSlotHandle.js, line 58