ViewLink Component

Introduction

The ViewLink component allows you to create a hyperlink to a given route within a component definition, automatically taking care of generating the appropriate path.

Examples

use('ElentraJS/View/Component/ViewLink.vue');

<!-- Link to a Named Route -->
<view-link to="sandbox.index">My Link</view-link>

<!-- Link to a Named Route with custom parameters -->
<view-link to="sandbox.index" :params="{ sandboxId: 3 }">My Link</view-link>

<!-- Link to a standard URL -->
<view-link href="https://google.com">Google Link</view-link>

<!-- When Active -->
<view-link to="sandbox.index" class="view-link-active">My Link</view-link>
<!-- When Child Active -->
<view-link to="sandbox.index" class="view-link-active">My Link</view-link>
<!-- Ignore Child Active -->
<view-link to="sandbox.index" exact="true">My Link</view-link>

<!-- When Error (route not defined) -->
<view-link to="sandbox.typo" class="view-link-error">My Link</view-link>

Last updated