PHP Classes

File: src/pages/SettingPage.vue

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   WP Emailer   src/pages/SettingPage.vue   Download  
File: src/pages/SettingPage.vue
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WP Emailer
Allow WordPress users to configure email settings
Author: By
Last change:
Date: 1 year ago
Size: 1,572 bytes
 

Contents

Class file image Download
<template> <div class="settings-page"> <SettingFormLoading v-if="isSettingsLoading" /> <SettingForm v-if="!isSettingsLoading" :default="settings" :change="onChangeInput" :settings="settings" /> </div> </template> <script> import { mapActions, mapGetters } from "vuex"; import { debounce } from "debounce"; import { validateSettings } from "../utils/validation"; import SettingForm from '../components/settings/SettingForm.vue'; import SettingFormLoading from "../components/settings/SettingFormLoading.vue"; export default { name: "SettingPage", components: { SettingForm, SettingFormLoading, }, data() { return { currentInput: {}, }; }, computed: { ...mapGetters(["alert", "isSettingsSaving", "isSettingsLoading", "settings"]) }, watch: { currentInput: debounce(function(val) { this.storeSettings(val); }, 500) }, methods: { ...mapActions(["storeSettings", "setAlert", "hideAlert"]), onChangeInput(input) { // Validate client side. const validate = validateSettings(input); if (!validate.valid) { this.setAlert({ message : validate.message, type : 'error' }); return; } else { if (alert.isVisible) { this.hideAlert(); } } this.currentInput = input; }, }, }; </script>