<template> <div class="eibs-tab"> <c-col :span="24"> <el-table :border="true" :data="itemList" style="width:80%,text-align:center" > <el-table-column label="编号" prop="tid" width="200px" > </el-table-column> <el-table-column label="标题" prop="theme" width="400px" > </el-table-column> <el-table-column label="发布机构" prop="unit" width="200px" > </el-table-column> <el-table-column label="时间" prop="dat" width="200px " > </el-table-column> <el-table-column label="操作" width="200px" fixed="right"> <template slot-scope="scope"> <c-button type="primary" size="small" @click="handleEdit(scope.$index, scope.row)" > 修改</c-button> <c-button type="danger" size="small" @click="handleDelete(scope.$index, scope.row)" > 删除</c-button> </template> </el-table-column> </el-table> </c-col> <!-- <table border="1"> <tr> <th>主题</th> <th>发布机构</th> <th>发布人</th> </tr> <tr v-for="notice in itemList" :key="notice.tid"> <td>{{notice.theme}}</td> <td>{{notice.unit}}</td> <td>{{notice.pubname}}</td> </tr> </table> --> </div> </template> <script> import Api from "~/service/Api"; import commonProcess from "~/mixin/commonProcess"; import CodeTable from "~/config/CodeTable"; import Utils from "~/utils/index"; import Event from "~/model/Notice/Event"; import { my } from "~/service/notice"; export default { inject: ["root"], // props: ["model", "codes"], mixins: [commonProcess], data(){ return { itemList:[ {} ], } }, methods:{ handleEdit(index, row) { console.log(index, row); }, handleDelete(index, row) { console.log(index, row); }, // ...Event, getList(){ my().then(res => { // console.log(res); this.itemList=res console.log(this.itemList); }) } }, created(){ this.getList(); }, // mounted(){ // } } </script> <style> </style>