• Docs

Getting Started

  1. Introduction

CLI

  1. General

    1. Installation
    2. Commands
    3. Scaffold a new project
    4. Generate a new component
    5. Install a component
  2. Generators

    1. Veams Generator

Framework

  1. Base

    1. Base Class
    2. Component Class
    3. Core
    4. Helpers
  2. Plugins

    1. Overview
    2. Logger
    3. Modules
    4. Media Query Handler
    5. Store
    6. Templater
    7. Vent
  3. Other Packages

    1. Http-Service

Methodology

  1. General

    1. Overview
  2. Instruments

    1. Regions
    2. Components
    3. Utilities
  3. Classes and Markup

    1. Introduction
    2. Global Styling
    3. Context Styling
    4. Modifier Styling
  4. JavaScript

    1. Modules
    2. Items
    3. Options
    4. Bringing It All Together

Plugins in VEAMS

In general the plugin system in VEAMS is a really simple one.


Usage of a plugin

When you want to use a plugin you first need to import the plugin and then just execute the use method of VEAMS:

import PluginXY from 'PluginXY';

// Add plugins to the Veams system
Veams.use(PluginXY);

You can pass in options to the plugin just by adding other parameters:

import PluginXY from 'PluginXY';

// Add plugins to the Veams system
Veams.use(PluginXY, {
	// Options object
    my: 'option'
});

Creation of plugins

When you want to create a plugin you only need to export an object with an initialize method in it. It is really easy.

Let’s say you want to add jQuery as DOM handler in VEAMS and want to share one single instance in the project:

  1. First you need to import the jQuery library
  2. Then you create a simple object
    • The pluginName is optional
    • Into the initialize method there will be passed the VEAMS object
  3. Execute use of VEAMS.
import $ from 'jquery';

const DomPlugin = {
  pluginName: '$',
  initialize: function(Veams) {
    Veams.$ = $;
  }
};

Veams.use(DomPlugin);

That’s it. You extended the general VEAMS object. Now you can just work with this instance by accessing it:

import Veams from './app.js';

Veams.$('.page-wrapper').addClass('is-working');

Available plugins

There are multiple plugins available.

Please keep in mind that the order of the initialisation of your used plugins can be important. In general it makes sense to use the following order:

// Intialize core of Veams
Veams.onInitialize(() => {
	Veams.use(VeamsLogger);
	Veams.use(VeamsVent); // VeamsVent enhances VeamsModules and VeamsMediaQueryHandler
	Veams.use(VeamsMediaQueryHandler);
	Veams.use(VeamsModules);
});
If you've spotted a typo or a mistake, or wish to add something on, you could write about this on Github | Gitter | © Made in Berlin with love