18 lines
433 B
TypeScript
18 lines
433 B
TypeScript
import { defineStore } from 'pinia';
|
|
import type { ProductTree } from '~~/types/banner';
|
|
|
|
interface ProductTreeState {
|
|
productTree: ProductTree[];
|
|
}
|
|
|
|
export const useProductTreeStore = defineStore('productTree', {
|
|
state: (): ProductTreeState => ({
|
|
productTree: [],
|
|
}),
|
|
actions: {
|
|
setProductTree(newProductTree: ProductTree[]): void {
|
|
this.productTree = newProductTree;
|
|
}
|
|
}
|
|
});
|