vue-nt-toast 0.1.4 → 0.2.0
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 +8 -6
- package/dist/nt-toast.es.js +4486 -0
- package/dist/nt-toast.umd.js +12 -0
- package/dist/toast.css +1 -0
- package/package.json +1 -1
- package/src/index.js +3 -1
- package/src/toast.js +3 -0
- package/src/toast.scss +9 -26
package/README.md
CHANGED
|
@@ -63,19 +63,21 @@ app.use(NtToast, defaultOptions)
|
|
|
63
63
|
|
|
64
64
|
```javascript
|
|
65
65
|
// get Proxy in current instance
|
|
66
|
-
import { getCurrentInctance } from 'vue';
|
|
67
|
-
|
|
66
|
+
// import { getCurrentInctance } from 'vue';
|
|
67
|
+
import { inject } from 'vue'
|
|
68
68
|
// composition api or setup
|
|
69
|
-
const { proxy } = getCurrentInstance();
|
|
69
|
+
// const { proxy } = getCurrentInstance();
|
|
70
|
+
|
|
71
|
+
const toast = inject('$ntToast')
|
|
70
72
|
```
|
|
71
73
|
### Creating toast (Show toast)
|
|
72
74
|
```javascript
|
|
73
75
|
// show success toast
|
|
74
|
-
|
|
76
|
+
toast.show('success', ..., ...)
|
|
75
77
|
|
|
76
78
|
// show another type
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
toast.show('info', ..., ...)
|
|
80
|
+
toast.show('danger', ..., ...)
|
|
79
81
|
```
|
|
80
82
|
---
|
|
81
83
|
|