create-mettle-app 1.9.3 → 1.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template-mettle/package.json +1 -1
- package/template-mettle/src/style/app.css +0 -4
- package/template-mettle/src/views/home.jsx +4 -6
- package/template-mettle-apps/package.json +1 -1
- package/template-mettle-apps/src/router/index.js +3 -3
- package/template-mettle-apps/src/views/home.jsx +3 -8
- package/template-mettle-apps-ts/package.json +1 -1
- package/template-mettle-apps-ts/src/views/home.tsx +3 -8
- package/template-mettle-ts/package.json +1 -1
- package/template-mettle-ts/src/style/app.css +0 -4
- package/template-mettle-ts/src/views/home.tsx +4 -6
- package/template-mettle-apps/src/styles/app.css +0 -7
- package/template-mettle-apps-ts/src/styles/app.css +0 -7
package/package.json
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { signal } from 'mettle';
|
|
2
|
-
|
|
3
1
|
export default function Home() {
|
|
4
|
-
|
|
2
|
+
let count = $signal(0);
|
|
5
3
|
|
|
6
4
|
function add() {
|
|
7
|
-
count
|
|
5
|
+
count++;
|
|
8
6
|
}
|
|
9
7
|
return (
|
|
10
8
|
<>
|
|
11
9
|
<button onClick={add}>Add</button>
|
|
12
|
-
<h1>{count
|
|
13
|
-
<input value={count
|
|
10
|
+
<h1>{count}</h1>
|
|
11
|
+
<input value={count} />
|
|
14
12
|
</>
|
|
15
13
|
);
|
|
16
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resetView } from 'mettle';
|
|
2
2
|
import { initRouter } from 'mettle-router';
|
|
3
3
|
|
|
4
|
-
import Home from '../
|
|
5
|
-
import About from '../
|
|
4
|
+
import Home from '../views/home';
|
|
5
|
+
import About from '../views/about';
|
|
6
6
|
|
|
7
7
|
const router = initRouter(
|
|
8
8
|
[
|
|
@@ -15,7 +15,7 @@ const router = initRouter(
|
|
|
15
15
|
template: About,
|
|
16
16
|
},
|
|
17
17
|
],
|
|
18
|
-
resetView
|
|
18
|
+
resetView,
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
export default router;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { signal, batch } from 'mettle';
|
|
2
1
|
import { linkTo } from 'mettle-router';
|
|
3
2
|
|
|
4
3
|
export default function Home() {
|
|
5
|
-
|
|
6
|
-
const count = signal(3);
|
|
4
|
+
let msg = $signal('hello');
|
|
7
5
|
|
|
8
6
|
function goAbout() {
|
|
9
7
|
linkTo({
|
|
@@ -16,17 +14,14 @@ export default function Home() {
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
function useChange() {
|
|
19
|
-
|
|
20
|
-
msg.value = 'world';
|
|
21
|
-
count.value++;
|
|
22
|
-
});
|
|
17
|
+
msg = 'world';
|
|
23
18
|
}
|
|
24
19
|
|
|
25
20
|
return (
|
|
26
21
|
<>
|
|
27
22
|
<button onClick={goAbout}>goAbout</button>
|
|
28
23
|
<h1>Home</h1>
|
|
29
|
-
<p onClick={useChange}>{msg
|
|
24
|
+
<p onClick={useChange}>{msg}</p>
|
|
30
25
|
</>
|
|
31
26
|
);
|
|
32
27
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { signal, batch } from 'mettle';
|
|
2
1
|
import { linkTo } from 'mettle-router';
|
|
3
2
|
|
|
4
3
|
export default function Home() {
|
|
5
|
-
|
|
6
|
-
const count = signal(3);
|
|
4
|
+
let msg = $signal('hello');
|
|
7
5
|
|
|
8
6
|
function goAbout() {
|
|
9
7
|
linkTo({
|
|
@@ -16,17 +14,14 @@ export default function Home() {
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
function useChange() {
|
|
19
|
-
|
|
20
|
-
msg.value = 'world';
|
|
21
|
-
count.value++;
|
|
22
|
-
});
|
|
17
|
+
msg = 'world';
|
|
23
18
|
}
|
|
24
19
|
|
|
25
20
|
return (
|
|
26
21
|
<>
|
|
27
22
|
<button onClick={goAbout}>goAbout</button>
|
|
28
23
|
<h1>Home</h1>
|
|
29
|
-
<p onClick={useChange}>{msg
|
|
24
|
+
<p onClick={useChange}>{msg}</p>
|
|
30
25
|
</>
|
|
31
26
|
);
|
|
32
27
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { signal } from 'mettle';
|
|
2
|
-
|
|
3
1
|
export default function Home() {
|
|
4
|
-
|
|
2
|
+
let count: any = $signal(0);
|
|
5
3
|
|
|
6
4
|
function add() {
|
|
7
|
-
count
|
|
5
|
+
count++;
|
|
8
6
|
}
|
|
9
7
|
return (
|
|
10
8
|
<>
|
|
11
9
|
<button onClick={add}>Add</button>
|
|
12
|
-
<h1>{count
|
|
13
|
-
<input value={count
|
|
10
|
+
<h1>{count}</h1>
|
|
11
|
+
<input value={count} />
|
|
14
12
|
</>
|
|
15
13
|
);
|
|
16
14
|
}
|