shop-web/src/pinia/stores/approval.ts

25 lines
603 B
TypeScript

import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { ReturnApprovalEntity } from '@/common/apis/approval/type'
export interface ApprovalDetail extends ReturnApprovalEntity {
goodsName: string
coverImg: string
}
export const useApprovalStore = defineStore('approval', () => {
const currentApproval = ref<ApprovalDetail | null>(null)
const setCurrentApproval = (approval: ApprovalDetail) => {
currentApproval.value = approval
}
return {
currentApproval,
setCurrentApproval
}
})
export function useApprovalStoreOutside() {
return useApprovalStore()
}