Browse Source

Fixed Toasts,they now can be called from any file

theflametrooper 8 years ago
parent
commit
554665d765
3 changed files with 15 additions and 3 deletions
  1. 10 1
      README.md
  2. 4 1
      frontend/App.vue
  3. 1 1
      frontend/package.json

+ 10 - 1
README.md

@@ -124,4 +124,13 @@ Run this command in your shell. You will have to do this command for every shell
 
 5. In both `frontend` and `backend` folders, do `npm install`.
 
-6. `nodemon backend/index.js`
+6. `nodemon backend/index.js`
+
+### Calling Toasts
+
+You can call Toasts using our custom package, [`vue-roaster`](https://github.com/atjonathan/vue-roaster), using the following code:
+
+```js
+import { Toast } from 'vue-roaster';
+Toast.methods.addToast('', 0);
+```

+ 4 - 1
frontend/App.vue

@@ -1,11 +1,14 @@
 <template>
 	<div>
 		<router-view></router-view>
+		<toast></toast>
 		<what-is-new></what-is-new>
 	</div>
 </template>
 
 <script>
+	import { Toast } from 'vue-roaster';
+
 	import WhatIsNew from './components/Modals/WhatIsNew.vue';
 
 	export default {
@@ -75,6 +78,6 @@
 				});
 			}*/
 		},
-		components: { WhatIsNew }
+		components: { Toast, WhatIsNew }
 	}
 </script>

+ 1 - 1
frontend/package.json

@@ -33,7 +33,7 @@
   "dependencies": {
     "node-sass": "^3.13.0",
     "vue": "^1.0.26",
-    "vue-roaster": "^1.0.7",
+    "vue-roaster": "^1.0.8",
     "vue-router": "^0.7.13"
   }
 }