App.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { css } from "@linaria/core";
  2. import { Layout } from "ant-design-vue";
  3. import { defineComponent } from "vue";
  4. const { Header, Content, Footer } = Layout;
  5. import HeaderComponent from "@/views/website/components/layout/Header";
  6. import FooterComponent from "@/views/website/components/layout/Footer";
  7. import { useArticle, useCategory } from "@/modules";
  8. import { Provider } from "@/components/Provider";
  9. export default defineComponent(() => {
  10. const storeCategory = useCategory();
  11. storeCategory.initCategories();
  12. const artStore = useArticle();
  13. artStore.initArticle();
  14. return () => (
  15. <Provider>
  16. <Layout>
  17. <Header class={HeaderLayout}>
  18. <HeaderComponent />
  19. </Header>
  20. <Content class={ContentLayout}>
  21. <router-view></router-view>
  22. </Content>
  23. <Footer class={FooterLayout}>
  24. <FooterComponent />
  25. </Footer>
  26. </Layout>
  27. </Provider>
  28. );
  29. });
  30. const HeaderLayout = css`
  31. &.ant-layout-header {
  32. /* position: fixed;
  33. left: 0;
  34. top: 0;
  35. z-index: 99;
  36. width: 100%; */
  37. height: auto;
  38. line-height: 1;
  39. padding: 0;
  40. background-color: transparent;
  41. }
  42. `;
  43. const ContentLayout = css`
  44. &.ant-layout-content {
  45. min-height: 100vh;
  46. }
  47. `;
  48. const FooterLayout = css`
  49. &.ant-layout-footer {
  50. height: auto;
  51. line-height: 1;
  52. padding: 0;
  53. background-color: transparent;
  54. }
  55. `;