LoginBox.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { css } from "@linaria/core";
  2. import { defineComponent } from "vue";
  3. import { useAuth } from "../..";
  4. export default defineComponent({
  5. setup(props, { slots }) {
  6. const auth = useAuth();
  7. const bannerStyle = auth.helper.createBgStyle(
  8. auth.config.banner?.background
  9. );
  10. return () => (
  11. <div class={containerRoot}>
  12. {auth.config.banner && (
  13. <section class="login-banner" style={bannerStyle}>
  14. <div class="banner-content">
  15. <pre class="content-title">{auth.config.banner.title}</pre>
  16. <pre class="content-subTit">{auth.config.banner.subTitle}</pre>
  17. </div>
  18. </section>
  19. )}
  20. {slots.default?.()}
  21. </div>
  22. );
  23. },
  24. });
  25. const containerRoot = css`
  26. display: flex;
  27. border-radius: 8px;
  28. background: #fff;
  29. overflow: hidden;
  30. .login-banner {
  31. width: 400px;
  32. color: @inf-text-color;
  33. .banner-content {
  34. display: flex;
  35. flex-direction: column;
  36. justify-content: space-between;
  37. height: 100%;
  38. background-color: rgba(0, 0, 0, 0.3);
  39. }
  40. pre {
  41. margin: 24px;
  42. font-family: Arial, Helvetica, sans-serif;
  43. }
  44. .content-title {
  45. font-size: 24px;
  46. color: #fff;
  47. }
  48. .content-subTit {
  49. font-size: 16px;
  50. color: #ccc;
  51. }
  52. }
  53. `;