Skip to content

Commit 5df3177

Browse files
committed
修正模板渲染邏輯。
1 parent 7dda8ce commit 5df3177

File tree

8 files changed

+66
-3
lines changed

8 files changed

+66
-3
lines changed

dist/QuickUI.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/QuickUI.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pardnchiu/quickui",
3-
"version": "0.6.10",
3+
"version": "0.6.11",
44
"description": "QuickUI is a lightweight frontend framework built on pure JavaScript and native APIs. Supports data binding, i18n support, event binding, conditional rendering, and loop rendering.",
55
"main": "dist/QuickUI.js",
66
"module": "dist/QuickUI.esm.js",

src/QuickUI.debug.js

540 Bytes
Binary file not shown.

src/function/htmlParser.ts

3 Bytes
Binary file not shown.

src/model/QUI.ts

533 Bytes
Binary file not shown.

static/md/en/model.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,37 @@
2121
})
2222
</script>
2323
```
24+
- result
25+
```HTML
26+
<body id="app">
27+
hint 123
28+
<h1 style="background: red;">test 123</h1>
29+
</body>
30+
```
31+
32+
- index.html
33+
```HTML
34+
<body id="app"></body>
35+
<script>
36+
document.addEventListener("DOMContentLoaded", async _ => {
37+
const test = await new QUI({
38+
data: {
39+
hint: "hint 123",
40+
title: "test 123"
41+
},
42+
render: () => `
43+
"{{ hint }}",
44+
h1 {
45+
style: "background: red;",
46+
children: [
47+
"{{ title }}"
48+
]
49+
}`
50+
}).fragment();
51+
document.getElementById("app").appendChild(test);
52+
});
53+
</script>
54+
```
2455
- result
2556
```HTML
2657
<body id="app">

static/md/zh/model.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 模板渲染
22

3+
34
- index.html
45
```HTML
56
<body id="app"></body>
@@ -21,6 +22,37 @@
2122
})
2223
</script>
2324
```
25+
- result
26+
```HTML
27+
<body id="app">
28+
hint 123
29+
<h1 style="background: red;">test 123</h1>
30+
</body>
31+
```
32+
33+
- index.html
34+
```HTML
35+
<body id="app"></body>
36+
<script>
37+
document.addEventListener("DOMContentLoaded", async _ => {
38+
const test = await new QUI({
39+
data: {
40+
hint: "hint 123",
41+
title: "test 123"
42+
},
43+
render: () => `
44+
"{{ hint }}",
45+
h1 {
46+
style: "background: red;",
47+
children: [
48+
"{{ title }}"
49+
]
50+
}`
51+
}).fragment();
52+
document.getElementById("app").appendChild(test);
53+
});
54+
</script>
55+
```
2456
- result
2557
```HTML
2658
<body id="app">

0 commit comments

Comments
 (0)