2.0.8 • Published 3 years ago

javasx v2.0.8

Weekly downloads
46
License
GNU GENERAL PUBLI...
Repository
-
Last release
3 years ago

X

The smallest and fastest Flutter like component framework you will ever meet :-)

Known Vulnerabilities License: GPL v3 npm version

This framework is used to make scalable javascript component that can be shared easily throughout the entire application. This framework is built purely on Vanilla Javascript and does not use HTML. The HTML DOM is created using Javascript. So you must have basic understanding of Javascript and must know how to manipulate DOM using JS.

Install

npm i javasx

Require In Project

import x from 'javasx';

Create a Component

// Demo.js
import x from 'javasx';
export default x({
	name: "Demo", // Property name is optional
	render(){ 
		// Must define a render method which must returns a DOM element
		let element = document.createElement("div");
		element.textContent = "Hello World";
		return element;
	},
	mounted(){
		// mounted method runs after the render() method 
		// You can query any child element and do something here
		// For example you can call any method which are defined in the method section below
		this.show("Hello World");
	},
	methods: {
		// Create any number of methods you want and access them using *this* keyword
		show: function(txt){
			alert(txt);
		}
	}
});

Use a Component

import Demo from "Demo.js";

let demo = new Demo(); // Instantiate the component using *new* keyword.

// You can call any method which are defined in the component and perform specific task --
demo.show("Hi..."); // will show alert

// The following code is needed only once for whole application --
let rootNode = document.getElementById("root");
rootNode.appendChild(demo.element);
2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago