detail.js 521 B

12345678910111213141516171819
  1. import { gotoPage } from '/src/utils/common'
  2. export default {
  3. name: "DetailMixin",
  4. data() {
  5. return {
  6. currentId: Number(this.$route.params.id),
  7. detailData: {},
  8. detailParam: {}, // 获取表单已有数据请求参,用于编辑表单请求
  9. getDetailApi: () => {}, // 获取详情 API
  10. }
  11. },
  12. async mounted() {
  13. const res = await this.getDetailApi(this.currentId)
  14. this.detailData = res.data
  15. },
  16. methods: {
  17. gotoPage: gotoPage,
  18. }
  19. }