wangchen147 e9a6b7a3a1 1.0.1
2025-10-17 15:13:57 +08:00

30 lines
733 B
TypeScript

import { defineStore } from 'pinia'
import { t } from '@/locale'
import { redirect, getToken, deepClone } from '@/utils/common'
interface GoodsDetail {
goodsDetail: AnyObject
}
const useGoodsDetailStore = defineStore('goodsDetail', {
state: (): GoodsDetail => {
return {
goodsDetail: {}
}
},
actions: {
setGoodsDetail(data: any, isAllUpdate:Boolean = false) { // 商品详情
if(isAllUpdate){
this.goodsDetail = data;
}else{
Object.assign(this.goodsDetail, data);
}
},
removeGoodsDetail(){ // 商品详情
this.goodsDetail = {}
}
}
})
export default useGoodsDetailStore