component.tsx 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { string } from "vue-types";
  2. import { useCompData } from ".";
  3. import { Text } from "../../..";
  4. import { createUIComp } from "../../../defines/createUIComp";
  5. import { css, cx } from "@linaria/core";
  6. export const Component = createUIComp({
  7. props: {
  8. compId: string().isRequired,
  9. },
  10. setup(props) {
  11. const { children } = useCompData(props.compId);
  12. return () => (
  13. <div class="flex flex-col items-center">
  14. <Text.Component
  15. class=""
  16. compId={children.title?.id}
  17. />
  18. <Text.Component
  19. class=""
  20. compId={children.subtitle?.id}
  21. />
  22. </div>
  23. );
  24. },
  25. });
  26. const border = css`
  27. position: relative;
  28. color: #999;
  29. &::after {
  30. content: "";
  31. position: absolute;
  32. bottom: 50%;
  33. width: 100%;
  34. height: 1px;
  35. background-color: currentColor;
  36. }
  37. &.left {
  38. &::after {
  39. left: 0.06rem;
  40. }
  41. }
  42. &.right {
  43. &::after {
  44. left: -0.06rem;
  45. }
  46. }
  47. `;