moments.vue 890 Bytes
Newer Older
leiqingsong's avatar
leiqingsong committed
1 2 3 4 5 6 7 8 9 10
<template>
  <div class="moments">
    <div class="title">
      <p>资讯</p>
    </div>
    <moment-item />
  </div>
</template>

<script>
leiqingsong's avatar
leiqingsong committed
11
import { findByUserId } from "@/api/infomation";
leiqingsong's avatar
leiqingsong committed
12 13 14 15
import MomentItem from "./components/momentItem.vue";

export default {
  name: "Moments",
leiqingsong's avatar
leiqingsong committed
16 17 18 19 20 21 22
  components: { MomentItem },
  created() {
    this.getMoment();
  },
  methods: {
    getMoment() {
      const params = {
leiqingsong's avatar
leiqingsong committed
23
        userId: JSON.parse(localStorage.getItem("user")).userId
leiqingsong's avatar
leiqingsong committed
24 25 26 27 28 29
      };
      findByUserId(params).then(res => {
        console.log(res);
      });
    }
  }
leiqingsong's avatar
leiqingsong committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
};
</script>

<style lang="scss" scoped>
.moments {
  box-sizing: border-box;
  p {
    margin: 0;
    padding: 0;
  }
}
.title {
  height: 46px;
  line-height: 46px;
  margin-bottom: 5px;
  text-align: center;
  font-family: PingFang-SC-Bold;
  font-size: 20px;
  font-weight: bold;
  background-color: #ffffff;
}
</style>