api.vue 1.7 KB
Newer Older
1
<template>
2 3 4
  <div>
    <div class="button-box clearflex">
      <el-button @click="addApi" type="primary">新增api</el-button>
5
    </div>
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    <el-table :data="tableData" border stripe>
      <el-table-column label="id" min-width="180" prop="ID"></el-table-column>
      <el-table-column label="api路径" min-width="180" prop="path"></el-table-column>
      <el-table-column label="api简介" min-width="180" prop="description"></el-table-column>
      <el-table-column fixed="right" label="操作" width="200">
        <template slot-scope="scope">
          <el-button @click="editApi(scope.row)" size="small" type="text">编辑</el-button>
          <el-button @click="deleteApi(scope.row)" size="small" type="text">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      :current-page="page"
      :page-size="pageSize"
      :page-sizes="[10, 30, 50, 100]"
      :style="{float:'right',padding:'20px'}"
      :total="total"
      @current-change="handleCurrentChange"
      @size-change="handleSizeChange"
      hide-on-single-page
      layout="total, sizes, prev, pager, next, jumper"
    ></el-pagination>
  </div>
29 30
</template>

Mr.奇淼('s avatar
注释  
Mr.奇淼( 已提交
31

32
<script>
Mr.奇淼('s avatar
注释  
Mr.奇淼( 已提交
33 34
// 获取列表内容封装在mixins内部  getTableData方法 初始化已封装完成

35 36 37
import { getApiList } from '@/api/api'
import infoList from '@/view/superAdmin/mixins/infoList'

38
export default {
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
  name: 'Api',
  mixins:[infoList],
  data() {
    return {
      listApi: getApiList,
      listKey:'list'
    }
  },
  methods: {

    addApi() {},
    editApi() {},
    deleteApi() {}
  },
  created() {
    this.getTableData()
  }
56 57
}
</script>
58 59 60 61 62 63 64
<style scoped lang="scss">
.button-box {
  padding: 10px 20px;
  .el-button {
    float: right;
  }
}
65
</style>