layout.tsx 622 B

12345678910111213141516171819
  1. import Layout from "./components/layout";
  2. import { UserController } from "./components/layout/UserController";
  3. import { defineComponent } from "vue";
  4. import { useAuth } from "@queenjs-modules/auth";
  5. import { useResource } from "@/modules/resource";
  6. export default defineComponent({
  7. setup() {
  8. const auth = useAuth();
  9. const ctrl = new UserController();
  10. ctrl.loginOut = auth.actions.logout;
  11. const { controls } = useResource();
  12. controls.categoryCtrl.init();
  13. return () => {
  14. ctrl.state.userInfo = auth.store.userInfo;
  15. return <Layout Controller={ctrl} slots={{}}></Layout>;
  16. };
  17. },
  18. });