每日总结(13)

所以时间:下午两个小时

代码:200

博客:1

知识点:

实现教师登录页面

 

利用element做出页面

vueRouter的使用, 路由器对页面的跳转

Axios对后台数据的获取

 

 1 <template>
 2   <div>
 3     <el-table
 4     :data="tableData"
 5     style="width: 100%"
 6     :row-class-name="tableRowClassName">
 7     <el-table-column
 8       prop="id"
 9       label="日期"
10       width="180">
11     </el-table-column>
12     <el-table-column
13       prop="name"
14       label="姓名"
15       width="180">
16     </el-table-column>
17     <el-table-column
18       prop="address"
19       label="地址">
20     </el-table-column>
21   </el-table>
22   </div>
23 </template>
24 
25 <script>
26   export default {
27     methods: {
28       tableRowClassName({row, rowIndex}) {
29         if (rowIndex === 1) {
30           return 'warning-row';
31         } else if (rowIndex === 3) {
32           return 'success-row';
33         }
34         return '';
35       }
36     },
37     created:function(){
38         this.$http.get("").then((response )=>{
39             this.tableData = response.data
40         })
41     },
42     data() {
43       return {
44         tableData: []
45       }
46     }
47   }
48 </script>

 

posted @ 2023-03-08 20:38  旺旺大菠萝  阅读(10)  评论(0编辑  收藏  举报