<template>
<div class="app-container">
{{list}}
</div>
</template>
<script>
import teacher from '@/api/teacher/teacher.js';
export default {
data() { // 初始化数据
return {
list: null
}
},
created() { // 初始化方法
this.getList();
},
methods: {
getList() { // 自定义方法
teacher.getList()
.then(response => {
console.log(response);
this.list = response;
})
.catch(error => {
});
}
}
}
</script>
22.前端页面的基本模板
最新推荐文章于 2022-02-23 11:55:17 发布