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

38 lines
753 B
JavaScript

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