import { gotoPage } from '/src/utils/common' export default { name: "DetailMixin", data() { return { currentId: Number(this.$route.params.id), detailData: {}, detailParam: {}, // 获取表单已有数据请求参,用于编辑表单请求 getDetailApi: () => {}, // 获取详情 API } }, async mounted() { const res = await this.getDetailApi(this.currentId) this.detailData = res.data }, methods: { gotoPage: gotoPage, } }