When you have scaffolded the project with the CLI you can skip the Installation and Usage section!
To install VEAMS
as framework you have to work with the core library.
npm install @veams/core --save
yarn add @veams/core
To use VEAMS
as framework just install and import the library:
JavaScript
import Veams from '@veams/core';
This imports a starter kit which initialize the core.
SCSS
// Reset (veams-reset or veams-normalize)
@import "./node_modules/veams/scss/veams-reset";
@import "./node_modules/veams/scss/veams";
That's it. The framework is integrated.
You can also create your own instance of the core by using the Core
class.
import Core from '@veams/core/lib/core';
let app = new Core({
namespace: 'App',
addToGlobal: false
});
The core of VEAMS
is nothing more than a simple object (Veams
). In general VEAMS
comes with some empty and predefined objects and a basic API.
- namespace {
String
} ['Veams'
] - Add your custom namespace. - addToGlobal {
Boolean
} [false
] - Add your previously defined namespace to the global window object.
- @param {
String
} name - Helper name which will be used in the registration process. - @param {
Function
} helperFunction - The helper function.
The method allows the registration of provided or custom helpers.
- @param {
Object
} plugin - Plugin object which extends theVEAMS
object.
This method provides the possibility to register a plugin, see section Creation of plugins.
The events object can be used to communicate between modules. It can be extended with further custom events. Just see @veams/plugin-vent.
Display the current VEAMS
version.
The detections object contains the current width and height, as well as if you are on a touch device or not.
The detections object will be updated when you use @veams/plugin-media-query-handler.
VEAMS
has some helpers which you can use. But you should use @veams/helpers
for usage.
All named plugins will be saved in this object. In the beginning it is empty.