From 1c0697b26681189acce6e90c8d6578a4711ef60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Fri, 3 Jan 2020 12:24:54 +0300 Subject: [PATCH] Vue: Auth page fixes.. --- resources/assets/js/views/auth/forgot.js | 40 +++++++++++++++++------- resources/assets/js/views/auth/login.js | 29 +++++++++++++++++ resources/assets/js/views/auth/reset.js | 9 +++--- 3 files changed, 62 insertions(+), 16 deletions(-) diff --git a/resources/assets/js/views/auth/forgot.js b/resources/assets/js/views/auth/forgot.js index 448d7a90e..a557d38e4 100644 --- a/resources/assets/js/views/auth/forgot.js +++ b/resources/assets/js/views/auth/forgot.js @@ -8,25 +8,43 @@ require('./../../bootstrap'); import Vue from 'vue'; -import DashboardPlugin from './../../plugins/dashboard-plugin'; - -import Global from './../../mixins/global'; - import Form from './../../plugins/form'; -// plugin setup -Vue.use(DashboardPlugin); - const app = new Vue({ el: '#app', - mixins: [ - Global - ], - data: function () { return { form: new Form('forgot') } }, + + mounted() { + this.checkNotify(); + }, + + methods: { + // Check Default set notify > store / update action + checkNotify: function () { + if (!flash_notification) { + return false; + } + + flash_notification.forEach(notify => { + let type = notify.level; + + this.$notify({ + message: notify.message, + timeout: 5000, + icon: 'fas fa-bell', + type + }); + }); + }, + + // Form Submit + onSubmit() { + this.form.submit(); + }, + } }); diff --git a/resources/assets/js/views/auth/login.js b/resources/assets/js/views/auth/login.js index 885c06f12..a0e5f9fed 100644 --- a/resources/assets/js/views/auth/login.js +++ b/resources/assets/js/views/auth/login.js @@ -17,5 +17,34 @@ const app = new Vue({ return { form: new Form('login') } + }, + + mounted() { + this.checkNotify(); + }, + + methods: { + // Check Default set notify > store / update action + checkNotify: function () { + if (!flash_notification) { + return false; + } + + flash_notification.forEach(notify => { + let type = notify.level; + + this.$notify({ + message: notify.message, + timeout: 5000, + icon: 'fas fa-bell', + type + }); + }); + }, + + // Form Submit + onSubmit() { + this.form.submit(); + }, } }); diff --git a/resources/assets/js/views/auth/reset.js b/resources/assets/js/views/auth/reset.js index c1d276363..81214e30a 100644 --- a/resources/assets/js/views/auth/reset.js +++ b/resources/assets/js/views/auth/reset.js @@ -8,13 +8,8 @@ require('./../../bootstrap'); import Vue from 'vue'; -import DashboardPlugin from './../../plugins/dashboard-plugin'; - import Form from './../../plugins/form'; -// plugin setup -Vue.use(DashboardPlugin); - const app = new Vue({ el: '#app', @@ -24,6 +19,10 @@ const app = new Vue({ } }, + mounted() { + this.checkNotify(); + }, + methods: { // Check Default set notify > store / update action checkNotify: function () {