PHP Classes

File: src/pages/Settings.vue

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   WP Vue Kit Plugin   src/pages/Settings.vue   Download  
File: src/pages/Settings.vue
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WP Vue Kit Plugin
Vue.js plugin to build WordPress user interfaces
Author: By
Last change:
Date: 1 year ago
Size: 1,075 bytes
 

Contents

Class file image Download
<script setup> import Button from '../components/button/Button.vue'; </script> <template> <div class="settings-page"> <h4>Settings</h4> <p> Demo settings using Vuex. This is of vuex working perfectly or not. </p> <form @submit="onSubmit" method="post"> <label for="numrows"> Number of rows </label> <br /> <input v-model="numrows" type="number" /> <br /> <br /> <Button type="submit">Save</Button> </form> </div> </template> <script> import { mapActions, mapGetters } from "vuex"; export default { name: "Settings", components: { Button }, data() { return { numrows: 5, } }, computed: { ...mapGetters(["isSaving", "settings"]) }, methods: { ...mapActions(["storeSettings"]), onSubmit(e) { e.preventDefault(); const setting = { numrows: parseInt(this.numrows) }; this.storeSettings(setting); }, }, watch: { settings: function () { console.log('Vuex state settings::', this.settings); }, }, }; </script>