-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsyntax-test.html
More file actions
102 lines (94 loc) · 3 KB
/
Copy pathsyntax-test.html
File metadata and controls
102 lines (94 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>HarmonyOS Highglith.js support</title>
</head>
<body>
<pre>
<code class="language-arkts">
// HarmonyOS
@Entry
@Component
struct Index {
@State counter: number = 0
build() {
// 生成一个经典的前端 counter
Column({}) {
Text('Blog Title').fontSize(24).fontWeight(FontWeight.Bold)
Text('Author: John Doe').fontSize(18).fontColor(Color.Blue)
Text('Published Date: July 1, 2022').fontSize(18).fontColor(Color.Blue)
Image('blog_image.jpg').width('100%').height(300)
Text('Blog Content goes here...').fontSize(18)
Button('Like', { type: ButtonType.Normal, stateEffect: true })
.borderRadius(8)
.backgroundColor(0xFF0000)
.width(100)
.height(40)
}.width('100%').margin(20).padding({ left: 20, right: 20 })
}
}
</code>
</pre>
<pre>
<code class="language-arkts">
Row() {
List({ space: 10 }) {
ListItem() {
Row({ space: 20 }) {
Image(this.avatarUrl)
.width(40)
.height(40)
Column() {
Text(this.nickname)
.fontSize(16)
.fontWeight('bold')
Text(this.lastMessage)
.fontSize(12)
.fontColor('#666666')
}
}
}
}
.width('100%')
.height(200)
.padding(10)
.backgroundColor(Color.Pink)
}
</code>
</pre>
<pre>
<code class="language-arkts">
@Entry
@Component
struct RefreshExample {
@State isRefreshing: boolean = false
@State counter: number = 0
build() {
Column() {
Text('Pull Down and isRefreshing: ' + this.isRefreshing)
.fontSize(30)
.margin(10)
Refresh({ refreshing: $$this.isRefreshing, offset: 120, friction: 100 }) {
Text('Pull Down and refresh: ' + this.counter)
.fontSize(30)
.margin(10)
}
.onStateChange((refreshStatus: RefreshStatus) => {
console.info('Refresh onStatueChange state is ' + refreshStatus)
})
}
}
}
</code>
</pre>
<!--import highlight.js-->
<script src="theme/highlight.js"></script>
<!--import highlightjs.css from cdn-->
<link rel="stylesheet" href="https://harmonyos-dev.github.io/aigc-harmonyos-sample/highlight.css">
<link rel="stylesheet" href="assets/custom.css">
<script src="assets/custom.js"></script>
</body>
</html>