rgc-alias
v0.0.1
Published
the function make regularjs-component to have an alias
Downloads
3
Readme
rgc-alias
A simple javascript utility for regular component to create an alias.
Install
npm install rgc-alias
Usage
//commonjs
var alias = require('rgc-alias');
//es6
import alias from 'rgc-alias';
//global
var alias = window['rgc-alias'];
//amd
define([
'rgc-alias'
], function(alias) {
...
})
Function
import Regular from 'regularjs';
import alias from 'rgc-alias';
const CustromComponent = Regular.extend({
name: 'custom-component',
config(data) {
}
})
//Component or Components as arguments
//such as alias([Comp1, Comp2...])
alias(CustromComponent);
//then you can get a new Component with your name
const newComp = CustromComponent.alias('anothe-name');