30 lines
603 B
JavaScript
30 lines
603 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 skus = ref(null);
|
|
|
|
// 商品是否可编辑
|
|
const canEdit = computed(() => (detailTag.value === "detail" ? false : true));
|
|
|
|
return {
|
|
selectedProperty,
|
|
goodsInfo,
|
|
skus,
|
|
canEdit,
|
|
detailTag,
|
|
};
|
|
});
|
|
|
|
export default useTradeStore;
|