mall-app-t/peach/store/trade.js

38 lines
753 B
JavaScript
Raw Normal View History

2024-06-12 18:33:39 +08:00
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
2024-06-05 18:58:12 +08:00
2024-06-12 18:33:39 +08:00
const useTradeStore = defineStore('trade', () => {
// 已选择规格类型
const selectedProperty = ref(null)
2024-06-05 18:58:12 +08:00
// 商品信息
const goodsInfo = ref(null)
2024-06-05 18:58:12 +08:00
// 详情标记
const detailTag = ref('edit')
2024-06-11 00:34:43 +08:00
// 是否触发保存操作
const isSave = ref(false)
2024-06-05 18:58:12 +08:00
// 规格类型,默认单规格
const specType = ref(false)
2024-06-11 00:34:43 +08:00
// 商品属性
const skus = ref(null)
2024-06-07 02:05:33 +08:00
// 商品是否可编辑
const canEdit = computed(() => (detailTag.value === 'detail' ? false : true))
return {
selectedProperty,
goodsInfo,
skus,
canEdit,
detailTag,
specType,
isSave,
}
2024-06-12 18:33:39 +08:00
})
export default useTradeStore