-
Notifications
You must be signed in to change notification settings - Fork 0
/
@props.html
230 lines (186 loc) · 7.35 KB
/
@props.html
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="main.js"></script>
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
<link rel="stylesheet" href="/bulma.min.css">
<script type="text/javascript" src="/main.js"></script>
<link rel="stylesheet" href="/style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="crossorigin">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@500&family=Noto+Sans+Mono:wght@500&family=Noto+Sans:wght@500&display=swap" rel="stylesheet">
<meta name="description" content="@props
Properties for child component
@props is the list of data that you can pass from parent.
With this feature you can create a child component tha" />
<meta name="og:title" content="@props" />
<meta name="og:description" content="@props
Properties for child component
@props is the list of data that you can pass from parent.
With this feature you can create a child component tha" />
<meta name="og:site_name" content="Rino" />
<meta name="og:url" content="https://rinojs.org/@props.html" />
<meta name="og:image" content=""/>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@props</title>
</head>
<body>
<div class="mainview columns">
<div class="column" id="sidebar">
<img src="/assets/rino256.png" alt="Rino Logo">
<aside class="menu">
<p class="menu-label">
Main
</p>
<ul class="menu-list">
<li><a href="/">Home</a></li>
<li><a href="/Shop.html">Shop</a></li>
<li><a href="/Support us.html">Support us</a></li>
<li><a href="/Get Help.html">Get Help</a></li>
</ul>
<p class="menu-label">
Getting Started
</p>
<ul class="menu-list">
<li><a href="/Introduction.html">Introduction</a></li>
<li><a href="/Installation.html">Installation</a></li>
<li><a href="/System.html">System</a></li>
</ul>
<p class="menu-label">
Rino
</p>
<ul class="menu-list">
<li><a href="/Page.html">Page</a></li>
<li><a href="/@component.html">@component</a></li>
<li><a href="/@props.html">@props</a></li>
<li><a href="/@preload.html">@preload</a></li>
<li><a href="/@data.html">@data</a></li>
<li><a href="/@tot.html">@tot</a></li>
<li><a href="/@md.html">@md</a></li>
<li><a href="/Inner Data.html">Inner Data</a></li>
<li><a href="/Coding.html">Coding</a></li>
<li><a href="/Comment.html">Comment</a></li>
<li><a href="/Escape.html">Escape</a></li>
<li><a href="/Rino API.html">Rino API</a></li>
</ul>
<p class="menu-label">
Rinokit
</p>
<ul class="menu-list">
<li><a href="/Rinokit.html">Rinokit</a></li>
<li><a href="/Component.html">Component</a></li>
<li><a href="/Data.html">Data</a></li>
<li><a href="/Rinokit API.html">Rinokit API</a></li>
</ul>
<p class="menu-label">
Extra
</p>
<ul class="menu-list">
<li><a href="/@event.html">@event</a></li>
</ul>
</aside>
</div>
<div id="cover" onclick="showSidebar()">
</div>
<main class="column">
<div class="header columns">
<div class="column">
<a role="button" id="menu-button" class="menu-button" onclick="showSidebar()">
<span></span>
<span></span>
<span></span>
</a>
</div>
<div class="select">
<select onchange="if(this.value) location.href=(this.value);">
<option value="" selected="selected" disabled="disabled" hidden="hidden">
Language
</option>
<option value="/">English</option>
<option value="/ko/">한국어</option>
</select>
</div>
</div>
<hr>
<h1>@props</h1>
<h2>Properties for child component</h2>
<p><code>@props</code> is the list of data that you can pass from parent.
With this feature you can create a child component that is unique, even though you are using the template of component multiple times. You can build a UI Kit with this feature.</p>
<p>./src/components/parent-component.tot:</p>
<pre><code><d:html>
{{ @component, ./src/components/child-component.tot, props1, props2 }}
</d:html>
<d:css>
</d:css>
<d:js>
</d:js>
<d:props1>
<div>
some html content...
</div>
</d:props1>
<d:props2>#222</d:props2>
</code></pre>
<p>./src/components/child-component.tot:</p>
<pre><code><d:html>
{{ @props[0] }}
</d:html>
<d:css>
.some-elelent
{
background-color: {{ @props[1] }};
}
</d:css>
</code></pre>
<p>result:</p>
<pre><code>html:
<div>
some html content...
</div>
css:
.some-elelent
{
background-color: #222;
}
</code></pre>
<h2>How to pass props inline</h2>
<p>From version v1.5.10, we can use a inline props feature.</p>
<p>Parent component:</p>
<pre><code><d:html>
{{ @component, filename, (#222), (<button></button>) }}
</d:html>
</code></pre>
<p>Child component:</p>
<pre><code><d:html>
{{ @props[1] }};
</d:html>
<d:css>
button {
color: {{ @props[0] }};
}
</d:css>
</code></pre>
<p>Result:</p>
<pre><code>html:
<button></button>
css:
button {
color: #222;
}
</code></pre>
<hr>
<div class="rino-footer">
<p>Built with <strong>Free, MIT licensed opensource project</strong> <a href="https://github.com/rinojs/rinojs" target="_blank"><strong>Rino</strong></a> and <a href="https://github.com/rinojs/rinodocs" target="_blank"><strong>Rinodocs</strong></a></p>
<a href="https://rinojs.org/" target="_blank">Rino Document</a> |
<a href="https://github.com/rinojs/rinojs" target="_blank">Rino Github</a> |
<a href="https://rinojs.org/sponsor.html" target="_blank">Rino Sponsor</a> |
<a href="https://rinojs.org/shop.html" target="_blank">Rino Shop</a> |
<a href="https://www.npmjs.com/package/rinojs" target="_blank">NPM</a>
</div>
</main>
</div>
</body>
</html>