var listBankComponent = { template: ` Bank Listing New Data `, mounted() { this.doSearch(); }, data() { return { query: "", headers: [{ text: "Code", align: "left", sortable: false, value: "M_BankCode" }, { text: "Name", align: "left", sortable: false, value: "M_BankName" }, { text: "Address", value: "M_BankAddress", sortable: false, align: "left", width: "30%" }, { text: "Branch", value: "M_BankBranch", sortable: false, align: "left" }, { text: "Action", value: "action", sortable: false, align: "center", width: "20%" } ] }; }, methods: { clearSearch() { this.query = ""; this.doSearch(); }, doSearch(page = 1, rowPerPage = 8) { if (this.query == null) this.query = ""; this.$store.dispatch("searchBank", { query: this.query, page, rowPerPage }); }, prevPage() { let c_page = this.page - 1; this.doSearch(c_page); }, nextPage() { let c_page = this.page + 1; this.doSearch(c_page); }, gotoPage(e) { let c_page = e; this.doSearch(c_page); } }, computed: { ...Vuex.mapState({ isLoading: state => state.isLoading, isError: state => state.isError, errorMessage: state => state.errorMessage, banks: state => state.rows, totalRecord: state => state.totalRecord, page: state => state.page, totalPage: state => state.totalPage }) }, updated() { console.log("Component Updated"); } }; export { listBankComponent };