index.ts 741 B

12345678910111213141516171819202122232425
  1. import { PageListController } from "@queenjs/controllers";
  2. import { ModuleRoot, RequestConfig } from "queenjs";
  3. import actions from "./actions";
  4. import { https } from "./http";
  5. import { ItemObject } from "./objects/item";
  6. import { stores } from "./stores";
  7. export default class ListModule extends ModuleRoot {
  8. config = this.setConfig({
  9. httpConfig: {
  10. baseURL: "./",
  11. },
  12. });
  13. store = this.createStore([stores]);
  14. actions = this.createActions(actions);
  15. https = this.createHttps([https]);
  16. controls = {
  17. backendList: new PageListController(this.config.httpConfig),
  18. };
  19. onReady() {
  20. this.controls.backendList.setCrudPrefix("/antique");
  21. }
  22. }
  23. export const { useList, initList, setList } = ListModule.hook("List");