发表于: 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 {
    displayflex;
    justify-contentcenter;
    align-itemscenter;
    margin10px 0;
    a {
      text-decorationnone;
      margin0 10px;
      -webkit-tap-highlight-colortransparent;
      color#000;
      border-bottom1px solid #fff;
    }

    .typeClick {
      border-bottom1px solid #000;
    }
  }

  footer {
    positionfixed;
    bottom0;
    height49px;
    displayflex;
    justify-contentspace-between;
    align-itemscenter;
    width90%;
    padding0 5%;
    background-color#e3e3e3;
    .foot {
      displayflex;
      flex-flowcolumn nowrap;
      justify-contentcenter;
      align-itemscenter;
      p {
        margin0;
        font-size12px;
      }
    }
  }
}
</style>


明天计划:继续写接口


返回列表 返回列表
评论

    分享到