-
Notifications
You must be signed in to change notification settings - Fork 0
/
Component.html
226 lines (178 loc) · 8.24 KB
/
Component.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
<!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="Component
Component in runtime
Rinokit just follows the standard of HTML and Web Component for building a component.
So if you know how to use a web c" />
<meta name="og:title" content="Component" />
<meta name="og:description" content="Component
Component in runtime
Rinokit just follows the standard of HTML and Web Component for building a component.
So if you know how to use a web c" />
<meta name="og:site_name" content="Rino" />
<meta name="og:url" content="https://rinojs.org/Component.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>Component</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>Component</h1>
<h2>Component in runtime</h2>
<p>Rinokit just follows the standard of HTML and Web Component for building a component.
So if you know how to use a web component. You are having more advantages for building a web page with Rinokit.</p>
<h2>Example:</h2>
<p>/src/preloads/preload.tot:</p>
<pre><code><d:js>
import Rino from 'rinokit';
const rino = new Rino();
<d:js>
<d:css>
</d:css>
</code></pre>
<h3>/src/components/component-name.tot:</h3>
<p>You must use template tag <code><template></template></code> and id <code>component-name</code> for component.
You don't have to place them multiple times. You only need one template for one component in a page.
The template is going to be hidden by default.</p>
<pre><code><d:html>
<template id="componentName">
{{ component, componentName2 }}
or
{{ component, componentName2, someId2 }}
<template>
<template id="componentName2">
<template>
</d:html>
<d:css>
some css...
</d:css>
<d:js>
some Javascript...
</d:js>
</code></pre>
<h3>In single page or single component:</h3>
<pre><code><d:html>
some html...
</d:html>
<d:js>
some Javascript...
async function addSomeComponent(target)
{
const element = rino.buildComponent("componentName", "someId");
target.append(element);
}
</d:js>
<d:css>
some CSS...
</d:css>
</code></pre>
<p>In the example, from <code>{{ component, componentName2, someId2 }}</code>,
<code>component</code> indicates that it is a component, <code>componentName2</code> indicates the name of component,
and <code>someId2</code> is id for component.
You can skip id part then it will be <code>{{ component, componentName2 }}</code>.</p>
<p>Child component's ID is added like: <code>parentId-childId</code>.
This feature help us to create a unique ID for all the component and we can manipulate them better.
In case of example the id of <code>{{ component, componentName2, someId2 }}</code> is <code>someId-someId2</code>.</p>
<p>If you want to render a component again, you can just build the component again and replace the old component with a new one.
And this is just efficient as you are controlling your page by small size, just like the popular web frameworks.</p>
<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>