Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Commit

Permalink
Fix: Can not use >1 pages.
Browse files Browse the repository at this point in the history
Release: alpha 0.2.4
  • Loading branch information
sheepbox8646 committed Aug 14, 2022
1 parent 4c6435f commit 7f75626
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ app.page({
data: {
x: 233333
},
mounted() {
console.log("end!!!");
},
mount: document.getElementById("root")
}, "id1");

Expand Down
1 change: 1 addition & 0 deletions dist/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export declare class TNTApp {
#private;
constructor();
page(createFunctions: Record<string, any>, ...page_id: string[]): void;
useExportPlugin(plugin: TNTPlugin): void;
get data(): object;
usePlugin(plugin: TNTPlugin): this;
}
Expand Down
5 changes: 4 additions & 1 deletion dist/src/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tntjs",
"version": "0.2.3x",
"version": "0.2.4",
"description": "The JavaScript framework for modern web.",
"main": "dist/src/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class TNTApp {
createFunctions: Record<string, any>,
...page_id: string[]
) {
if (this.#pageid in page_id) return;
if (!(page_id.includes(this.#pageid))) return ;
(typeof createFunctions.data !== "undefined") ? this.#useData(createFunctions.data) : undefined;
(typeof createFunctions.computed !== "undefined") ? this.#useComputed(createFunctions.computed) : undefined;
(typeof createFunctions.effect !== "undefined") ? this.#useEffect(createFunctions.effect) : undefined;
Expand Down

0 comments on commit 7f75626

Please sign in to comment.