发表于: 2019-11-09 23:25:51
1 1154
今天完成的事情:
1.试图在页面弄异步请求接口,但是一直404,明天另一个老哥问问什么状况,他是怎么弄的:
<template>
<!-- 搜索结果 -->
<div class="result">
<div class="keyWord">
<router-link to="/search">
<searchOnly></searchOnly>
</router-link>
</div>
<div class="choice">
<router-link to="/result" :class="{'typeClick':page==1}" @click.native="page=1">课程</router-link>
<router-link
to="/result/teachAssistant"
:class="{'typeClick':page==2}"
@click.native="page=2"
>文章</router-link>
</div>
<main>
<router-view></router-view>
</main>
</div>
</template>
<script>
import searchOnly from "../components/SearchOnly";
export default {
name: "result",
components: {
searchOnly
},
data() {
return {
page: null
};
},
created(){
this.studyList();
},
methods: {
studyList(){
this.axios({
method:'get',
url:'a/list/study',
data:{
type:20,
title:'光',
grade:11,
status:1,
}
}).then(res=>{
window.console.log(res);
}).catch(err=>{
window.console.log(err);
})
}
}
};
</script>
<style lang="scss" scope>
.result {
.choice {
display: flex;
justify-content: center;
align-items: center;
margin: 10px 0;
a {
text-decoration: none;
margin: 0 10px;
-webkit-tap-highlight-color: transparent;
color: #000;
border-bottom: 1px solid #fff;
}
.typeClick {
border-bottom: 1px solid #000;
}
}
footer {
position: fixed;
bottom: 0;
height: 49px;
display: flex;
justify-content: space-between;
align-items: center;
width: 90%;
padding: 0 5%;
background-color: #e3e3e3;
.foot {
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-items: center;
p {
margin: 0;
font-size: 12px;
}
}
}
}
</style>
明天计划:继续写接口
评论