FAQ

Table of Contents


How to update npm to latest version?

  1. Go to the folder with installed nodejs
cd "C:\Program Files\nodejs"
# or
cd "C:\Program Files (x86)\nodejs"
  1. Install lattest version of npm
npm install npm@latest

What version of node.js use?

We recomended use nodejs version more than 6, but better use 7 or 8.

How to remove demo app?

Run command in terminal npm run cleanup. This command run script tools/removeDemo.js

How to use jQuery and jQuery plugins?

Create new module using npm run amo command or maually.

In javascript part of module for example modules/slider/slider.js

// slider.js
import $ from "jquery";
import "ion-rangeslider"; // jQuery plugin

/**
 * Simple module
 *
 * @param {String} selector - DOM selector
 * @param {*} options - options for jQuery plugin
 * @returns jQuery plugin instance
 */
export default (selector, options) => {
  // You can rewrite default options here
  const defaultOptions = {
    grid: true
  };

  const mergedOptions = Object.assign({}, defaultOptions, options);

  return $(selector).ionRangeSlider(mergedOptions);
};

In main javascript file use this wrapper

// main.js
import Slider from "@/modules/slider/slider";

Slider("#slider", {
  type: "double",
  min: 0,
  max: 1000,
  from: 200,
  to: 500
});

And finaly import plugin styles, if it needed

// slider.styl
@import "ion-rangeslider/css/ion.rangeSlider.css"

// your styles rewrite