You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP

als-component

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

als-component - npm Package Compare versions

Comparing version

to
0.3.0

@@ -12,3 +12,4 @@ class Component {

}
}
try {module.exports = Component} catch{}
{
"name": "als-component",
"version": "0.2.0",
"version": "0.3.0",
"description": "Managing components and states.",

@@ -5,0 +5,0 @@ "main": "export.js",

# Als-component
## About
Als-component allows you to manage dom content with JavaScript.
**new in V0.3** : ``router.js``
To show html colored code inside string in js, use es6-string-html plugin in vsCode and /*html*/`html code`.

@@ -131,1 +137,40 @@

```
## router.js
router.js has function ``router(routes)``. The function allows you to use html layout for js files and functions.
Here is example:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<script src="/node_modules/als-component/component.js"></script>
<script src="/node_modules/als-component/router.js"></script>
<script>
router({
test1:'/test1.js',
test:() => new Componenet('test',/*html*/`
<main id="main">Hello from test fn</main>
`).update('main')
})
</script>
<title>Todos</title>
</head>
<body>
<nav>
<a href="?route=test">test</a>
<a href="?route=test1">test1</a>
</nav>
<main id="main"></main>
</body>
</html>
```
test1.js file
```javascript
new Componenet('test',/*html*/`
<main id="main">Hello from test1.js</main>
`).update('main')
```