You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
GHHub/src/stores/Products/Index.js

36 lines
862 B
JavaScript

import { create } from 'zustand';
import { devtools } from 'zustand/middleware';
import { fetchJSON } from '@/utils/request';
import { HT_HOST } from '@/config';
const initialState = {
loading: false,
productsList: [
{
'audit_date': '2001-03-03',
'travel_agency_name': '新油低外',
'travel_agency_id': '650000200301029585',
'created_by': '冯丽',
'create_date': '1989-06-20',
'lastedit_memo': 'nostrud ad eu',
'audited_by': '黎静',
'audit_state': '1',
},
],
};
export const useProductsStore = create(
devtools((set, get) => ({
// 初始化状态
...initialState,
// state actions
setProductsList: (productsList) => set({ productsList }),
reset: () => set(initialState),
// side effects
}))
);
export default useProductsStore;