import Layout from "./components/layout";
import { UserController } from "./components/layout/UserController";
import { defineComponent } from "vue";
import { useAuth } from "@queenjs-modules/auth";
import { useResource } from "@/modules/resource";

export default defineComponent({
  setup() {
    const auth = useAuth();
    const ctrl = new UserController();
    ctrl.loginOut = auth.actions.logout;
    const { controls } = useResource();
    controls.categoryCtrl.init();
    return () => {
      ctrl.state.userInfo = auth.store.userInfo;
      return <Layout Controller={ctrl} slots={{}}></Layout>;
    };
  },
});
