|
@@ -4,33 +4,38 @@
|
|
|
|
|
|
## Installation
|
|
## Installation
|
|
|
|
|
|
-`npm install -S --production toasters`
|
|
|
|
|
|
+`npm install --save --production toasters`
|
|
|
|
|
|
## Usage
|
|
## Usage
|
|
|
|
|
|
|
|
+**HTML:**
|
|
|
|
+
|
|
|
|
+```html
|
|
|
|
+<div id="toasts-container" class="position-right position-bottom"></div>
|
|
```
|
|
```
|
|
-<template>
|
|
|
|
- <toast></toast>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
- import { Toast } from 'toasters';
|
|
|
|
-
|
|
|
|
- export default {
|
|
|
|
- ready() {
|
|
|
|
- new Toast({
|
|
|
|
- content: "This is a test for content",
|
|
|
|
- persistant: true,
|
|
|
|
- position: {
|
|
|
|
- horizontal: "right",
|
|
|
|
- vertical: "bottom"
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-</script>
|
|
|
|
|
|
+
|
|
|
|
+**JS:**
|
|
|
|
+
|
|
|
|
+```js
|
|
|
|
+import Toast from "toasters";
|
|
|
|
+
|
|
|
|
+new Toast({
|
|
|
|
+ content: "Hello World",
|
|
|
|
+ persistant: true
|
|
|
|
+});
|
|
```
|
|
```
|
|
|
|
|
|
|
|
+**Preview:**
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+## Potential future additions
|
|
|
|
+- Design improvements
|
|
|
|
+- Error handling (i.e. you haven't provided any content for the toast)
|
|
|
|
+- Ability to parse markdown or html
|
|
|
|
+- Ability to change to persistent
|
|
|
|
+- Small reaction to drag e.g. push it over the edge
|
|
|
|
+
|
|
<!--See [example](https://github.com/jonathan-grah/vue-roaster/tree/master/example) folder for more details.-->
|
|
<!--See [example](https://github.com/jonathan-grah/vue-roaster/tree/master/example) folder for more details.-->
|
|
|
|
|
|
## Contributing
|
|
## Contributing
|