-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
114 lines (99 loc) · 2.64 KB
/
index.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
---
layout: default
title: Home
---
<div class="page-home">
<h1>Beyond</h1>
<div>這裡放全站共用元件</div>
<h2>Ruby / Rails</h2>
<div class="doc">
<h3>使用方式</h3>
<div class="code">
{% highlight ruby %}
gem "beyond-rails"
{% endhighlight %}
</div>
<div class="code-label">在 application.js</div>
<div class="code">
{% highlight js %}
//= require beyond
{% endhighlight %}
</div>
<div class="code-label">在 application.scss</div>
<div class="code">
{% highlight scss %}
@import "beyond-sprockets";
@import "beyond";
{% endhighlight %}
</div>
</div>
<h2>Webpack</h2>
<div class="doc">
<h3>安裝</h3>
<div class="code">
{% highlight shell %}
yarn add @superlanding/beyond --exact
{% endhighlight %}
</div>
<h3>使用</h3>
<div class="code-label">在 sass 檔案引入樣式</div>
<div class="code">
{% highlight scss %}
// 定義 css 圖片路徑與 font icons 路徑
$beyond-icon-font-path: '~@superlanding/beyond/src/font/';
$beyond-css-img-path: '~@superlanding/beyond/src/sass/img/';
@import '~@superlanding/beyond/src/sass/index.scss';
{% endhighlight %}
</div>
<h2>JS 元件存取</h2>
<h3>自動載入</h3>
<ul class="list-style-disc">
<li>必須在 document ready 之後執行</li>
<li>
自動載入目前只支援以下元件:
<ul class="list-style-disc">
<li>Alert</li>
<li>Checkbox</li>
<li>Dropdown</li>
<li>Menu</li>
<li>Navbar</li>
<li>Radio</li>
<li>Sidebar</li>
<li>Tabbox</li>
<li>Tooltip</li>
</ul>
</li>
</ul>
<div class="code-label">JavaScript Modules</div>
<div class="code">
{% highlight js %}
import { bind, unbindAll } from '@superlanding/beyond'
// bind 執行後會返回一個 unbind 方法
// unbind 只會 destroy 透過 bind 綁定的元件
const unbind = bind()
// 或是可以使用 unbindAll 解除所有載入 Beyond 後所生成的元件
unbindAll()
{% endhighlight %}
</div>
<div class="code-label">Browser</div>
<div class="code">
{% highlight js %}
const unbind = window.beyond.bind()
window.beyond.unbindAll()
{% endhighlight %}
</div>
<h3>手動載入</h3>
<div class="code-label">JavaScript Modules</div>
<div class="code">
{% highlight js %}
import { Datepicker, Dropdown, Modal, Tabbox, Toast, Tooltip } from '@superlanding/beyond'
{% endhighlight %}
</div>
<div class="code-label">Browser</div>
<div class="code">
{% highlight js %}
const { Datepicker, Dropdown, Modal, Tabbox, Toast, Tooltip } = window.beyond
{% endhighlight %}
</div>
</div>
</div>