vue-nt-toast 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,35 +1,119 @@
|
|
|
1
|
-
|
|
1
|
+
vue-nt-toast
|
|
2
|
+
================
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
2
10
|
|
|
3
|
-
|
|
11
|
+

|
|
4
12
|
|
|
5
|
-
## Recommended IDE Setup
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
`vue-nt-toast` is a JavaScript notification system library. It is made available through the installation of the plugin in the Vue project.
|
|
8
15
|
|
|
9
|
-
|
|
16
|
+
It is designed to operate outside the application (the top layer) so as not to affect the application's layer system as much as possible, and provides status indications of "success", "risk", "information", "attention", and "important" depending on the type of content.
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
You can set multiple options across the system, including theme, location, and snack bar mode, to reflect them in the entire system, and you can also apply options that can be changed every time the user runs it.
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
`vue-nt-toast`는 자바스크립트 알림 시스템 라이브러리 입니다. Vue 프로젝트 내 plugin 설치를 통해서 사용 가능하도록 제작 되었습니다.
|
|
21
|
+
어플리케이션 외부(최상단 레이어)에서 동작하여 내부 레이어 시스템에 영향을 받지 않게 설계 되었으며 컨텐츠의 종류에 따라 “성공”, “위험”, “정보”, “주의”, “중요” 의 상태 표시를 제공하고있습니다.
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
npm install
|
|
17
|
-
```
|
|
23
|
+
테마, 위치, 스낵바 모드 등 여러 옵션을 전역에서 설정 하여 전체 시스템에 반영 하도록 할수있고, 사용자가 실행 할때 마다 변경 가능한 옵션을 적용 할수도 있습니다.
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
---
|
|
26
|
+
## Installation
|
|
20
27
|
|
|
21
28
|
```sh
|
|
22
|
-
npm
|
|
29
|
+
$ npm install vue-nt-toast —-save
|
|
23
30
|
```
|
|
31
|
+
---
|
|
32
|
+
## Plugin registration
|
|
24
33
|
|
|
25
|
-
|
|
34
|
+
```javascript
|
|
35
|
+
Import { createApp } from “vue”;
|
|
36
|
+
// import module
|
|
37
|
+
import NtToast from “vue-nt-toast”;
|
|
38
|
+
// import style css or use yours
|
|
39
|
+
import “vue-nt-toast/toast.css”;
|
|
40
|
+
|
|
41
|
+
const app = createApp(App)
|
|
26
42
|
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
Const defaultOptions = {
|
|
44
|
+
// You can set your initial options here
|
|
45
|
+
};
|
|
46
|
+
app.use(NtToast, defaultOptions)
|
|
29
47
|
```
|
|
48
|
+
---
|
|
30
49
|
|
|
31
|
-
|
|
50
|
+
## Usage
|
|
32
51
|
|
|
33
|
-
|
|
34
|
-
|
|
52
|
+
* show(type, contents, options)
|
|
53
|
+
* contents.title (Toast title)
|
|
54
|
+
* contents.description (Toast description)
|
|
55
|
+
|
|
56
|
+
### Set for use global function
|
|
57
|
+
|
|
58
|
+
```javascript
|
|
59
|
+
// get Proxy in current instance
|
|
60
|
+
import { getCurrentInctance } from 'vue';
|
|
61
|
+
|
|
62
|
+
// composition api or setup
|
|
63
|
+
const { proxy } = getCurrentInstance();
|
|
64
|
+
```
|
|
65
|
+
### Creating toast (Show toast)
|
|
66
|
+
```javascript
|
|
67
|
+
// show success toast
|
|
68
|
+
proxy.$ntToast.show('success', ..., ...)
|
|
69
|
+
|
|
70
|
+
// show another type
|
|
71
|
+
proxy.$ntToast.show('info', ..., ...)
|
|
72
|
+
proxy.$ntToast.show('danger', ..., ...)
|
|
35
73
|
```
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Parameters
|
|
77
|
+
|
|
78
|
+
| Name | Description | Required |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `type` | Status or Colors | `true` |
|
|
81
|
+
| `contnts.type` | Title Text | |
|
|
82
|
+
| `contents.description` | Description Text | `true` |
|
|
83
|
+
| `options` | User Custom Options | |
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Properties
|
|
87
|
+
|
|
88
|
+
* **useTitle**: _boolean_ ▶︎ `true`
|
|
89
|
+
Setting for show/hide toast title.
|
|
90
|
+
|
|
91
|
+
* **useIcon**: _boolean_ ▶︎ `true`
|
|
92
|
+
Setting for show/hide toast status icon.
|
|
93
|
+
|
|
94
|
+
* **round**: _boolean_ ▶︎ `false`
|
|
95
|
+
Setting for enable/disable round border.
|
|
96
|
+
|
|
97
|
+
* **closeButton**: _boolean_ ▶︎ `true`
|
|
98
|
+
Setting for show/hide close button.
|
|
99
|
+
|
|
100
|
+
* **displayOnTop**: _boolean_ ▶︎ `false`
|
|
101
|
+
Setting for order type when toast create.
|
|
102
|
+
|
|
103
|
+
* **snackbar**: _boolean_ ▶︎ `false`
|
|
104
|
+
Setting for snackbar mode.
|
|
105
|
+
|
|
106
|
+
* **freeze**: _boolean_ ▶︎ `false`
|
|
107
|
+
Setting for auto close off.
|
|
108
|
+
|
|
109
|
+
* **timeout**: _number_ ▶︎ `5000`
|
|
110
|
+
Setting for delay time.
|
|
111
|
+
|
|
112
|
+
* **theme**: _string_ ▶︎ `''`
|
|
113
|
+
Setting for toast style.
|
|
114
|
+
`light` `icon` `icon-bg` `line`
|
|
115
|
+
|
|
116
|
+
* **position**: _string_ ▶︎ `top-right`
|
|
117
|
+
Setting for create position.
|
|
118
|
+
v-align(`top`, `bottom`) and h-align(`left`, `center`, `right`) and `full-width`
|
|
119
|
+
---
|