UNPKG

@lipagas/storefront-engine

Version:

Headless Commerce & Marketplace Extension for Fleetbase

44 lines (39 loc) 1.07 kB
import { action } from '@ember/object'; import BaseController from '@lipagas/storefront-engine/controllers/base-controller'; import { tracked } from '@glimmer/tracking'; export default class CustomersIndexViewController extends BaseController { /** * The currently active view tab ('details' by default). * * @type {String} * @tracked */ @tracked view = 'details'; /** * An array of query parameters to be serialized in the URL. * * @type {String[]} * @tracked */ @tracked queryParams = ['view']; /** * Transitions back to the "customers.index" route. * * @method * @action * @returns {Transition} The transition object representing the route change. */ @action transitionBack() { return this.transitionToRoute('customers.index'); } /** * Updates the active view tab. * * @method * @param {String} tab - The name of the tab to activate. * @action */ @action onTabChanged(tab) { this.view = tab; } }