Java's new project learning online notes - day2(3)

3.1.3 page content improvement
According to the needs of the page content, improve the list field, add paging components.

  <el‐button type="primary" v‐on:click="query"  size="small">query</el‐button>  
  style="width: 100%">   
 <el‐table‐column type="index" width="60">  
   <el‐table‐column prop="pageName" label="page name" width="120"> 
 <el‐table‐column prop="pageAliase" label="alias" width="120"> 
  <el‐table‐column prop="pageType" label="Page type" width="150">  
 <el‐table‐column prop="pageWebPath" label="Access path" width="250"> 
   <el‐table‐column prop="pagePhysicalPath" label="Physical path" width="250"> 
  <el‐table‐column prop="pageCreateTime" label="Creation time" width="180" >
     layout="prev, pager, next"  
    :total="total" :current‐page="" style="float:right;">   
</div> </template> 
  export default { 
   data() {   
   return {  
       page:1,//Page number  
         size:2//Number of displays per page      
      //Paging query

changePage:function () {   
  query:function () {  
  } </script>

2, test

3.2 Api call
3.2.1 Api method definition
Cms.js is defined in the api directory of CMS module, and the following JS method is defined in cms.js. This method implements the http request server page query interface.

//public is the tool class encapsulation of axios,
The HTTP request method import HTTP from '. /.. /.. / base / API / public' export const page ﹐ list = (page, size, params) = > {return http. Requestquickget (' http://localhost:31001/cms/page/list/'+page+'/'+size) }

axios implements the encapsulation of http methods. vue.js does not continue to maintain Vue resource officially. axios is recommended. 3.2.2 Api call
The front-end page imports cms.js and calls JS method to request the server page query interface. 1) import cms.js

import * as cmsApi from '../api/cms'

Calling the page_list method in the query method

query:function () {
   console.log(res) =  
   this.list = res.queryResult.list

Tags: Java axios Vue

Posted on Sun, 01 Dec 2019 11:50:49 -0800 by pacome