|
15 | 15 | <a href="https://www.npmjs.com/package/modular-openscriptjs"><img src="https://img.shields.io/npm/v/modular-openscriptjs.svg?style=flat-square" alt="NPM Version"></a> |
16 | 16 | <a href="https://github.com/OpenScriptJs/modular-openscript/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/modular-openscriptjs.svg?style=flat-square" alt="License"></a> |
17 | 17 | <a href="https://github.com/OpenScriptJs/modular-openscript/issues"><img src="https://img.shields.io/github/issues/OpenScriptJs/modular-openscript?style=flat-square" alt="Issues"></a> |
| 18 | + <a href="https://www.npmjs.com/package/modular-openscriptjs"><img src="https://img.shields.io/npm/dt/modular-openscriptjs.svg?style=flat-square" alt="Downloads"></a> |
18 | 19 | </p> |
19 | 20 |
|
20 | 21 | ## Introduction |
@@ -71,11 +72,13 @@ We didn't just build another framework; we built a toolset for developers who va |
71 | 72 | ### Installation |
72 | 73 |
|
73 | 74 | Start a project (All basic configurations are done) |
| 75 | + |
74 | 76 | ```bash |
75 | 77 | npm create openscript-app <project-name> <template> |
76 | 78 | ``` |
77 | 79 |
|
78 | 80 | Available templates: |
| 81 | + |
79 | 82 | - `basic` |
80 | 83 | - `tailwind` |
81 | 84 | - `bootstrap` |
@@ -448,11 +451,11 @@ You are now set up with the basic structure of an OpenScript application! |
448 | 451 |
|
449 | 452 | OpenScript is built around an **Inversion of Control (IoC) Container**. Instead of importing global instances directly, you access core services via the `app()` helper. |
450 | 453 |
|
451 | | -| Service | Access | Description | |
452 | | -| :---------------- | :----------------------- | :--------------------------------------------- | |
453 | | -| **Markup Engine** | `app('h')` | Helper proxy for creating DOM elements. | |
454 | | -| **Router** | `app('router')` | Manages navigation and URL handling. | |
455 | | -| **Broker** | `app('broker')` | Central event bus for decoupled communication. | |
| 454 | +| Service | Access | Description | |
| 455 | +| :---------------- | :-------------- | :--------------------------------------------- | |
| 456 | +| **Markup Engine** | `app('h')` | Helper proxy for creating DOM elements. | |
| 457 | +| **Router** | `app('router')` | Manages navigation and URL handling. | |
| 458 | +| **Broker** | `app('broker')` | Central event bus for decoupled communication. | |
456 | 459 |
|
457 | 460 | --- |
458 | 461 |
|
@@ -859,19 +862,19 @@ h.div( |
859 | 862 | v(user, (u) => `Hello, ${u.name}!`), |
860 | 863 | ); |
861 | 864 | ``` |
| 865 | + |
862 | 866 | To style the anonymous component wrapper, you can add a third argument to the `v` helper. The third parameter should be an object like `{ c_attr: {class: 'mb-3 d-block'} }` |
| 867 | + |
863 | 868 | ```javascript |
864 | 869 | import { v, app } from "modular-openscriptjs"; |
865 | 870 | const h = app("h"); |
866 | 871 |
|
867 | 872 | h.div( |
868 | 873 | h.h1("Welcome"), |
869 | 874 | // Only this specific span node updates when 'user' state changes |
870 | | - v( |
871 | | - user, |
872 | | - (u) => h.span(`Hello, ${u.value.name}!`), |
873 | | - { c_attr: {class: 'mb-3 d-block'} } |
874 | | - ), |
| 875 | + v(user, (u) => h.span(`Hello, ${u.value.name}!`), { |
| 876 | + c_attr: { class: "mb-3 d-block" }, |
| 877 | + }), |
875 | 878 | ); |
876 | 879 | ``` |
877 | 880 |
|
|
0 commit comments