<template> <div class="all-income"> <div v-for="item in incomeList" :key="item.id" class="list-item"> <span style="color:#333333">{{ item.yearMonth }}</span> <span>{{ item.income }}</span> </div> </div> </template> <script> import { showIncomeRecord } from "@/api/wallet"; export default { name: "AllIncome", data() { return { incomeList: [] }; }, monted() { this.getAllRecord(); }, methods: { getAllRecord() { const params = { userId: this.$userId }; showIncomeRecord(params).then(res => { if (res.code === 0) { this.incomeList = res.data; } }); } } }; </script> <style lang="scss" scoped> .all-income { box-sizing: border-box; padding: 10px 16px; } .list-item { box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; height: 50px; margin-bottom: 10px; padding: 0 15px; font-size: 16px; background-color: #ffffff; } </style>