component.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { css, cx } from "@linaria/core";
  2. import { string } from "vue-types";
  3. import { useCompData } from ".";
  4. import { Text } from "../../../basicUI";
  5. import { createUIComp } from "../../../defines/createUIComp";
  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 items-center justify-center py-10px px-5px">
  14. <div class={cx(border, "left w-25px text-12px text-right")}>
  15. &frasl; &frasl;
  16. </div>
  17. <Text.Component class="px-25px max-w-240px" compId={children.title} />
  18. <div class={cx(border, "right w-25px text-12px")}>&frasl; &frasl;</div>
  19. </div>
  20. );
  21. },
  22. });
  23. const border = css`
  24. position: relative;
  25. color: #999;
  26. &::after {
  27. content: "";
  28. position: absolute;
  29. bottom: 50%;
  30. width: 100%;
  31. height: 1px;
  32. background-color: currentColor;
  33. }
  34. &.left {
  35. &::after {
  36. left: 3px;
  37. }
  38. }
  39. &.right {
  40. &::after {
  41. left: -3px;
  42. }
  43. }
  44. `;